core-legacy/util.cpp
changeset 580 783e91c5f445
parent 545 07e5df11f9fc
child 662 5a936e981523
     1.1 --- a/core-legacy/util.cpp	Sun Nov 23 21:21:49 2008 -0600
     1.2 +++ b/core-legacy/util.cpp	Sun Nov 23 21:22:04 2008 -0600
     1.3 @@ -82,91 +82,6 @@
     1.4  	}
     1.5  }
     1.6  
     1.7 -/* :TODO: this should skip string literals */
     1.8 -void UTIL_TrimComments(char *buffer)
     1.9 -{
    1.10 -	int num_sc = 0;
    1.11 -	size_t len = strlen(buffer);
    1.12 -	if (buffer)
    1.13 -	{
    1.14 -		for (int i = len - 1; i >= 0; i--)
    1.15 -		{
    1.16 -			if (buffer[i] == '/')
    1.17 -			{
    1.18 -				if (++num_sc >= 2 && i==0)
    1.19 -				{
    1.20 -					buffer[i] = '\0';
    1.21 -					return;
    1.22 -				}
    1.23 -			} else {
    1.24 -				if (num_sc >= 2)
    1.25 -				{
    1.26 -					buffer[i] = '\0';
    1.27 -					return;
    1.28 -				}
    1.29 -				num_sc = 0;
    1.30 -			}
    1.31 -			/* size_t won't go below 0, manually break out */
    1.32 -			if (i == 0)
    1.33 -			{
    1.34 -				break;
    1.35 -			}
    1.36 -		}
    1.37 -	}
    1.38 -}
    1.39 -
    1.40 -void UTIL_KeySplit(const char *str, char *buf1, size_t len1, char *buf2, size_t len2)
    1.41 -{
    1.42 -	size_t start;
    1.43 -	size_t len = strlen(str);
    1.44 -
    1.45 -	for (start = 0; start < len; start++)
    1.46 -	{
    1.47 -		if (!isspace(str[start]))
    1.48 -		{
    1.49 -			break;
    1.50 -		}
    1.51 -	}
    1.52 -
    1.53 -	size_t end;
    1.54 -	for (end = start; end < len; end++)
    1.55 -	{
    1.56 -		if (isspace(str[end]))
    1.57 -		{
    1.58 -			break;
    1.59 -		}
    1.60 -	}
    1.61 -	
    1.62 -	size_t i, c = 0;
    1.63 -	for (i = start; i < end; i++, c++)
    1.64 -	{
    1.65 -		if (c >= len1)
    1.66 -		{
    1.67 -			break;
    1.68 -		}
    1.69 -		buf1[c] = str[i];
    1.70 -	}
    1.71 -	buf1[c] = '\0';
    1.72 -
    1.73 -	for (start = end; start < len; start++)
    1.74 -	{
    1.75 -		if (!isspace(str[start]))
    1.76 -		{
    1.77 -			break;
    1.78 -		}
    1.79 -	}
    1.80 -
    1.81 -	for (c = 0; start < len; start++, c++)
    1.82 -	{
    1.83 -		if (c >= len2)
    1.84 -		{
    1.85 -			break;
    1.86 -		}
    1.87 -		buf2[c] = str[start];
    1.88 -	}
    1.89 -	buf2[c] = '\0';
    1.90 -}
    1.91 -
    1.92  bool UTIL_PathCmp(const char *path1, const char *path2)
    1.93  {
    1.94  	size_t pos1 = 0, pos2 = 0;