aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial/basics.source
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2014-02-01 18:27:01 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2014-02-01 18:27:44 -0500
commit8be095cea5971d90f59a07f9bf49c58204c6cb2b (patch)
tree8a05a8a3a60f1109b91e9aee3a1b9f39c1a69994 /src/tutorial/basics.source
parent7fe4e357d2e1f72ced069d2bb9562b4be2f4fdf5 (diff)
downloadpostgresql-8be095cea5971d90f59a07f9bf49c58204c6cb2b.tar.gz
postgresql-8be095cea5971d90f59a07f9bf49c58204c6cb2b.zip
Fix some wide-character bugs in the text-search parser.
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.
Diffstat (limited to 'src/tutorial/basics.source')
0 files changed, 0 insertions, 0 deletions