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:
18
src/utils.c
18
src/utils.c
@@ -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'))) {
|
||||
|
||||
Reference in New Issue
Block a user