Bug #1097 » glob.c-asc.diff
glob.c-asc Sat Jan 12 08:48:02 2013 | ||
---|---|---|
95 | 95 |
#include <string.h> |
96 | 96 |
#include <unistd.h> |
97 | 97 |
#include <wchar.h> |
98 |
#include <wctype.h> |
|
98 | 99 | |
99 | 100 |
#define DOLLAR '$' |
100 | 101 |
#define DOT '.' |
... | ... | |
484 | 485 |
/* Copy the string. */ |
485 | 486 |
while (n > 0) { |
486 | 487 |
w = (s1++)->wc; |
487 |
/* Only single byte characters. */
|
|
488 |
if (wctomb(s2, w) == 1) {
|
|
488 |
/* Character class names must be ASCII. */
|
|
489 |
if (iswascii(w)) {
|
|
489 | 490 |
n--; |
490 |
s2++;
|
|
491 |
*s2++ = w;
|
|
491 | 492 |
} else { |
492 | 493 |
return (-1); /* invalid character class */ |
493 | 494 |
} |