| 182 |
|
if (r == NULL) return(1); |
| 183 |
|
do |
| 184 |
|
*r++ = *s++; |
| 185 |
< |
while(*s && !isspace(*s)); |
| 185 |
> |
while (*s && !isspace(*s)); |
| 186 |
|
*r = '\0'; |
| 187 |
|
return(1); |
| 188 |
|
} |
| 213 |
|
buf[MAXLINE-2] = '\n'; |
| 214 |
|
if (fgets(buf, MAXLINE, fp) == NULL) |
| 215 |
|
return(-1); |
| 216 |
< |
if (buf[0] == '\n') |
| 216 |
> |
if (buf[buf[0]=='\r'] == '\n') |
| 217 |
|
return(0); |
| 218 |
|
if (buf[MAXLINE-2] != '\n') { |
| 219 |
|
ungetc(buf[MAXLINE-2], fp); /* prevent false end */ |
| 262 |
|
case '*': /* match any string */ |
| 263 |
|
while (p[1] == '*') p++; |
| 264 |
|
do |
| 265 |
< |
if ( (p[1]=='?' || p[1]==*s) && |
| 265 |
> |
if ( (p[1]=='?') | (p[1]==*s) && |
| 266 |
|
globmatch(p+1,s) ) |
| 267 |
|
return(1); |
| 268 |
|
while (*s++); |
| 275 |
|
if (!*p) |
| 276 |
|
return(0); |
| 277 |
|
if (*p == '-') { |
| 278 |
< |
setmatch += p[-1] <= *s && *s <= p[1]; |
| 278 |
> |
setmatch += (p[-1] <= *s && *s <= p[1]); |
| 279 |
|
if (!*++p) |
| 280 |
|
break; |
| 281 |
|
} else |
| 282 |
< |
setmatch += *p == *s; |
| 282 |
> |
setmatch += (*p == *s); |
| 283 |
|
} |
| 284 |
|
if (!setmatch) |
| 285 |
|
return(0); |