*** ext/standard/file.c.org Tue Oct 23 20:18:48 2001 --- ext/standard/file.c Mon Feb 25 06:12:52 2002 *************** *** 2115,2121 **** lineEnd = emalloc(sizeof(char) * (len + 1)); bptr = buf; tptr = buf + strlen(buf) -1; ! while ( isspace((int)*tptr) && (*tptr!=delimiter) && (tptr > bptr) ) tptr--; tptr++; strcpy(lineEnd, tptr); --- 2115,2121 ---- lineEnd = emalloc(sizeof(char) * (len + 1)); bptr = buf; tptr = buf + strlen(buf) -1; ! while ( isspace((unsigned char)*tptr) && (*tptr!=delimiter) && (tptr > bptr) ) tptr--; tptr++; strcpy(lineEnd, tptr); *************** *** 2141,2147 **** do { /* 1. Strip any leading space */ ! while(isspace((int)*bptr) && (*bptr!=delimiter)) bptr++; /* 2. Read field, leaving bptr pointing at start of next field */ if (*bptr == '"') { /* 2A. handle quote delimited field */ --- 2141,2147 ---- do { /* 1. Strip any leading space */ ! while(isspace((unsigned char)*bptr) && (*bptr!=delimiter)) bptr++; /* 2. Read field, leaving bptr pointing at start of next field */ if (*bptr == '"') { /* 2A. handle quote delimited field */ *************** *** 2176,2182 **** } bptr = buf; tptr = buf + strlen(buf) -1; ! while ( isspace((int)*tptr) && (*tptr!=delimiter) && (tptr > bptr) ) tptr--; tptr++; strcpy(lineEnd, tptr); *tptr++ = ' '; *tptr = 0; --- 2176,2182 ---- } bptr = buf; tptr = buf + strlen(buf) -1; ! while ( isspace((unsigned char)*tptr) && (*tptr!=delimiter) && (tptr > bptr) ) tptr--; tptr++; strcpy(lineEnd, tptr); *tptr++ = ' '; *tptr = 0; *************** *** 2191,2197 **** *tptr=0; /* terminate temporary string */ if (strlen(temp)) { tptr--; ! while (isspace((int)*tptr) && (*tptr!=delimiter)) *tptr-- = 0; /* strip any trailing spaces */ } if (*bptr == delimiter) bptr++; } --- 2191,2197 ---- *tptr=0; /* terminate temporary string */ if (strlen(temp)) { tptr--; ! while (isspace((unsigned char)*tptr) && (*tptr!=delimiter)) *tptr-- = 0; /* strip any trailing spaces */ } if (*bptr == delimiter) bptr++; }