Overview
Comment: | OFString: Fix fallback for no strto[fd]_l |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
33820d3f5f4522073dcee2b31d00a587 |
User & Date: | js on 2024-03-17 14:17:01 |
Other Links: | manifest | tags |
Context
2024-03-17
| ||
14:26 | GitHub Actions: Add MSYS2 check-in: 86e7ac0d52 user: js tags: trunk | |
14:17 | OFString: Fix fallback for no strto[fd]_l check-in: 33820d3f5f user: js tags: trunk | |
13:58 | OFFileManagerTests: Skip xattrs if not supported check-in: e878e67397 user: js tags: trunk | |
Changes
Modified src/OFString.m from [1a3f564904] to [7d2c8dc066].
︙ | ︙ | |||
2336 2337 2338 2339 2340 2341 2342 | return NAN; if ([stripped caseInsensitiveCompare: @"-NAN"] == OFOrderedSame) return -NAN; #if defined(HAVE_STRTOF_L) || defined(HAVE_USELOCALE) const char *UTF8String = self.UTF8String; #else | > > > > > > | | | | > | < | | | | | > | 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 | return NAN; if ([stripped caseInsensitiveCompare: @"-NAN"] == OFOrderedSame) return -NAN; #if defined(HAVE_STRTOF_L) || defined(HAVE_USELOCALE) const char *UTF8String = self.UTF8String; #else OFString *decimalSeparator = [OFLocale decimalSeparator]; const char *UTF8String; if ([decimalSeparator isEqual: @"."]) UTF8String = self.UTF8String; else /* * If we have no strtof_l, we have no other choice than to * replace the locale's decimal point with something that will * be rejected and replacing "." with the locale's decimal * point. */ UTF8String = [[self stringByReplacingOccurrencesOfString: decimalSeparator withString: @"!"] stringByReplacingOccurrencesOfString: @"." withString: decimalSeparator] .UTF8String; #endif char *endPtr = NULL; float value; errno = 0; #if defined(HAVE_STRTOF_L) value = strtof_l(UTF8String, &endPtr, cLocale); |
︙ | ︙ | |||
2396 2397 2398 2399 2400 2401 2402 | return NAN; if ([stripped caseInsensitiveCompare: @"-NAN"] == OFOrderedSame) return -NAN; #if defined(HAVE_STRTOD_L) || defined(HAVE_USELOCALE) const char *UTF8String = self.UTF8String; #else | > > > > > > | | | | > | < | | | | | > | 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 | return NAN; if ([stripped caseInsensitiveCompare: @"-NAN"] == OFOrderedSame) return -NAN; #if defined(HAVE_STRTOD_L) || defined(HAVE_USELOCALE) const char *UTF8String = self.UTF8String; #else OFString *decimalSeparator = [OFLocale decimalSeparator]; const char *UTF8String; if ([decimalSeparator isEqual: @"."]) UTF8String = self.UTF8String; else /* * If we have no strtod_l, we have no other choice than to * replace the locale's decimal point with something that will * be rejected and replacing "." with the locale's decimal * point. */ UTF8String = [[self stringByReplacingOccurrencesOfString: decimalSeparator withString: @"!"] stringByReplacingOccurrencesOfString: @"." withString: decimalSeparator] .UTF8String; #endif char *endPtr = NULL; double value; errno = 0; #if defined(HAVE_STRTOD_L) value = strtod_l(UTF8String, &endPtr, cLocale); |
︙ | ︙ |