Skip to content

CFString: skip leading whitespace in numeric string values - #87

Merged
rfm merged 1 commit into
gnustep:masterfrom
DTW-Thalion:fix/cfstring-numeric-whitespace
Sep 6, 2026
Merged

rfm merged 1 commit into
gnustep:masterfrom
DTW-Thalion:fix/cfstring-numeric-whitespace

Conversation

@DTW-Thalion

Copy link
Copy Markdown
Contributor

CFStringGetIntValue and CFStringGetDoubleValue passed the whole string to the
number formatter, which does not accept leading whitespace, so a value such as
" 42" returned 0. Apple skips leading whitespace before parsing. Skip leading
whitespace and parse from the first non-whitespace character. Verified against
Apple CoreFoundation.

CFStringGetIntValue and CFStringGetDoubleValue passed the whole string to the
number formatter, which fails on leading whitespace and returned zero. Skip
leading whitespace and parse from there.
@DTW-Thalion
DTW-Thalion force-pushed the fix/cfstring-numeric-whitespace branch from 61877c7 to 99e4589 Compare July 24, 2026 15:14
@DTW-Thalion DTW-Thalion reopened this Jul 24, 2026
@DTW-Thalion DTW-Thalion reopened this Jul 27, 2026
@rfm
rfm merged commit 1a13259 into gnustep:master Sep 6, 2026
3 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants