On 16/10/2025 22:47, Collin Funk wrote:
Hi Pádraig,
Pádraig Brady <[email protected]> writes:
+ /* Skip a single blank or NBSP between the number and suffix. */
+ mcel_t g = mcel_scanz (*endptr);
+ if (c32isblank (g.ch) || c32isnbspace (g.ch))
+ (*endptr) += g.len;
Looks good.
if (**endptr == '\0')
break; /* Treat as no suffix. */
if (!valid_suffix (**endptr))
- return SSE_INVALID_SUFFIX;
+ {
+ /* Trailing blanks are allowed. */
+ while (isblank (to_uchar (**endptr)))
+ (*endptr)++;
+ if (**endptr == '\0')
+ break;
+
+ return SSE_INVALID_SUFFIX;
+ }
Any reason not to do the same here? This one only handles ' ' and '\t'.
Oh right, good call. I'll squash this in:
@@ -681,8 +686,7 @@ simple_strtod_human (char const *input_str,
if (!valid_suffix (**endptr))
{
/* Trailing blanks are allowed. */
- while (isblank (to_uchar (**endptr)))
- (*endptr)++;
+ *endptr = skip_str_matching (*endptr, newline_or_blank, true);
if (**endptr == '\0')
break;
I'll also add another commit to remove isblank() from
process_suffixed_number(), and add a multi-byte blank test.
cheers,
Padraig