Revision 399d23e19c9cf3cf94561e0137f59a44530d0efb authored by Tom Lane on 01 February 2014, 23:27:04 UTC, committed by Tom Lane on 01 February 2014, 23:27:48 UTC
In p_isdigit and other character class test functions generated by the p_iswhat macro, the code path for non-C locales with multibyte encodings contained a bogus pointer cast that would accidentally fail to malfunction if types wchar_t and wint_t have the same width. Apparently that is true on most platforms, but not on recent Cygwin releases. Remove the cast, as it seems completely unnecessary (I think it arose from a false analogy to the need to cast to unsigned char when dealing with the <ctype.h> functions). Per bug #8970 from Marco Atzeri. In the same functions, the code path for C locale with a multibyte encoding simply ANDed each wide character with 0xFF before passing it to the corresponding <ctype.h> function. This could result in false positive answers for some non-ASCII characters, so use a range test instead. Noted by me while investigating Marco's complaint. Also, remove some useless though not actually buggy maskings and casts in the hand-coded p_isalnum and p_isalpha functions, which evidently got tested a bit more carefully than the macro-generated functions.
1 parent 141119c
File | Mode | Size |
---|---|---|
config | ||
contrib | ||
doc | ||
src | ||
.gitignore | -rw-r--r-- | 360 bytes |
COPYRIGHT | -rw-r--r-- | 1.2 KB |
GNUmakefile.in | -rw-r--r-- | 3.7 KB |
Makefile | -rw-r--r-- | 1.5 KB |
README | -rw-r--r-- | 1.3 KB |
README.git | -rw-r--r-- | 816 bytes |
aclocal.m4 | -rw-r--r-- | 385 bytes |
configure | -rwxr-xr-x | 850.2 KB |
configure.in | -rw-r--r-- | 62.7 KB |
Computing file changes ...