diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-07 00:24:59 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-07 00:24:59 +0000 |
| commit | 0bd61548ab8d1ac5fee63f48ee9b384502a51ad6 (patch) | |
| tree | b0c63b75585d0c396e67a3acd204e226b13eae4b /contrib/tsearch2/ispell/spell.c | |
| parent | 4d46274b33db52618ccf49550213b4d5ce4a7981 (diff) | |
| download | postgresql-0bd61548ab8d1ac5fee63f48ee9b384502a51ad6.tar.gz | |
Solve the 'Turkish problem' with undesirable locale behavior for case
conversion of basic ASCII letters. Remove all uses of strcasecmp and
strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp;
remove most but not all direct uses of toupper and tolower in favor of
pg_toupper and pg_tolower. These functions use the same notions of
case folding already developed for identifier case conversion. I left
the straight locale-based folding in place for situations where we are
just manipulating user data and not trying to match it to built-in
strings --- for example, the SQL upper() function is still locale
dependent. Perhaps this will prove not to be what's wanted, but at
the moment we can initdb and pass regression tests in Turkish locale.
Diffstat (limited to 'contrib/tsearch2/ispell/spell.c')
| -rw-r--r-- | contrib/tsearch2/ispell/spell.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/tsearch2/ispell/spell.c b/contrib/tsearch2/ispell/spell.c index 838d995702..10b0ca9e40 100644 --- a/contrib/tsearch2/ispell/spell.c +++ b/contrib/tsearch2/ispell/spell.c @@ -10,7 +10,7 @@ #define MAX_NORM 1024 #define MAXNORMLEN 256 -#define STRNCASECMP(x,y) (strncasecmp(x,y,strlen(y))) +#define STRNCASECMP(x,y) pg_strncasecmp(x, y, strlen(y)) #define GETWCHAR(W,L,N,T) ( ((uint8*)(W))[ ((T)=='p') ? (N) : ( (L) - 1 - (N) ) ] ) #define GETCHAR(A,N,T) GETWCHAR( (A)->repl, (A)->replen, N, T ) @@ -304,19 +304,19 @@ NIImportAffixes(IspellDict * Conf, const char *filename) continue; } } - if (!STRNCASECMP(str, "suffixes")) + if (STRNCASECMP(str, "suffixes")==0) { suffixes = 1; prefixes = 0; continue; } - if (!STRNCASECMP(str, "prefixes")) + if (STRNCASECMP(str, "prefixes")==0) { suffixes = 0; prefixes = 1; continue; } - if (!STRNCASECMP(str, "flag ")) + if (STRNCASECMP(str, "flag ")==0) { s = str + 5; flagflags=0; |
