Changeset: 596a01b378da for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/596a01b378da
Modified Files:
monetdb5/modules/mal/txtsim.c
Branch: Jul2021
Log Message:
Do checking for ASCII-ness on the whole string.
Relying on isalpha doesn't cut it.
diffs (21 lines):
diff --git a/monetdb5/modules/mal/txtsim.c b/monetdb5/modules/mal/txtsim.c
--- a/monetdb5/modules/mal/txtsim.c
+++ b/monetdb5/modules/mal/txtsim.c
@@ -227,13 +227,14 @@ SCode(unsigned char c)
}
static str
-soundex_code(char *Name, char *Key)
+soundex_code(const char *Name, char *Key)
{
char LastLetter;
int Index;
- if ((*Name & 0x80) != 0)
- throw(MAL,"soundex", SQLSTATE(42000) "Soundex function not
available for non ASCII strings");
+ for (const char *p = Name; *p; p++)
+ if ((*p & 0x80) != 0)
+ throw(MAL,"soundex", SQLSTATE(42000) "Soundex function
not available for non ASCII strings");
/* set default key */
strcpy(Key, SoundexKey);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list