Branch: Tag:

2016-12-17

2016-12-17 01:53:25 by Martin Nilsson <nilsson@fastmail.com>

Corrected WIDE_ISSPACE to actually work on all Unicode white spaces.

18:   #include "pike_float.h"   #include "pike_types.h"   #include "block_allocator.h" + #include "whitespace.h"      #include <errno.h>   #include <ctype.h>
3261:    if (base < 0 || base > MBASE) return 0;    if (!WIDE_ISALNUM(c = EXTRACT_PCHARP(str)))    { -  while (WIDE_ISSPACE(c)) +  while (wide_isspace(c))    {    INC_PCHARP(str,1);    c=EXTRACT_PCHARP(str);
3406:       if(!WIDE_ISALNUM(c = EXTRACT_PCHARP(str)))    { -  while(WIDE_ISSPACE(c)) +  while(wide_isspace(c))    {    INC_PCHARP(str,1);    c = EXTRACT_PCHARP(str);
3549:    s = nptr;       /* Eat whitespace. */ -  while (EXTRACT_PCHARP(s) <256 && WIDE_ISSPACE(EXTRACT_PCHARP(s))) INC_PCHARP(s,1); +  while (EXTRACT_PCHARP(s) <256 && wide_isspace(EXTRACT_PCHARP(s))) INC_PCHARP(s,1);       /* Get the sign. */    sign = EXTRACT_PCHARP(s) == '-' ? -1 : 1;
3614:    * We need to find the sign of the exponent by hand.    */    p_wchar2 c; -  while(WIDE_ISSPACE(c = EXTRACT_PCHARP(s))) { +  while(wide_isspace(c = EXTRACT_PCHARP(s))) {    INC_PCHARP(s, 1);    }    if (endptr != NULL)
3736:    }    UNREACHABLE(return 0);   } +  + PMOD_EXPORT int wide_isspace(int c) + { +  switch(c) +  { +  SPACECASE16; +  return 1; +  } +  return 0; + }