Skip to content
Snippets Groups Projects
Commit d290b76b authored by Per Hedbor's avatar Per Hedbor
Browse files

Fundamental properties of empty strings corrected.

An empty string:
- IS lowercase
- IS uppercase

'STRING_IS_LOWERCASE' means the same string will be returned for
lower_case(str), and 'STRING_IS_UPPERCASE' means the same string will
be returned for upper_case(str).

Having this be wrong for the empty string is not really a good idea,
since when strings are constructed using += the bits will not be set
correctly if you start with the empty string.

Also note: All code using string ranges really needs a special case
for the empty string, since its range of characters, when checked
using check_string_range, will be 0..255 (loose check), or
-MAX_INT32..MAX_INT32 (non-loose check).

This is done correctly in the 'string_has_null' function, which is
what is supposed to be used to check if strings contain null
characters.
parent d018a515
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment