locate: use g_utf8_casefold() instead of string_toupper()

string_toupper() and strDupToUpper() were not able to deal with
character sets other than US-ASCII.  Use GLib's g_utf8_casefold()
for strings.
This commit is contained in:
Max Kellermann
2008-10-15 19:36:37 +02:00
parent 7366191f0d
commit 047043d2a8
5 changed files with 16 additions and 30 deletions

View File

@@ -24,7 +24,6 @@
#include <assert.h>
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
#include <pwd.h>
#include <fcntl.h>
@@ -45,23 +44,6 @@ char *myFgets(char *buffer, int bufferSize, FILE * fp)
return ret;
}
char *string_toupper(char *str)
{
int i = strlen(str);
char *ret = str;
for (; --i >= 0; ++str)
*str = toupper((int)(*str));
return ret;
}
char *strDupToUpper(char *str)
{
return string_toupper(xstrdup(str));
}
void stripReturnChar(char *string)
{
while (string && (string = strchr(string, '\n'))) {