|
@@ -18,6 +18,7 @@
|
|
#include <stdlib.h>
|
|
#include <stdlib.h>
|
|
#include <wchar.h>
|
|
#include <wchar.h>
|
|
#include <wctype.h>
|
|
#include <wctype.h>
|
|
|
|
+#include "locale_impl.h"
|
|
|
|
|
|
#define END 0
|
|
#define END 0
|
|
#define UNMATCHABLE -2
|
|
#define UNMATCHABLE -2
|
|
@@ -229,7 +230,7 @@ static int fnmatch_internal(const char *pat, size_t m, const char *str, size_t n
|
|
* On illegal sequences we may get it wrong, but in that case
|
|
* On illegal sequences we may get it wrong, but in that case
|
|
* we necessarily have a matching failure anyway. */
|
|
* we necessarily have a matching failure anyway. */
|
|
for (s=endstr; s>str && tailcnt; tailcnt--) {
|
|
for (s=endstr; s>str && tailcnt; tailcnt--) {
|
|
- if (s[-1] < 128U) s--;
|
|
|
|
|
|
+ if (s[-1] < 128U || MB_CUR_MAX==1) s--;
|
|
else while ((unsigned char)*--s-0x80U<0x40 && s>str);
|
|
else while ((unsigned char)*--s-0x80U<0x40 && s>str);
|
|
}
|
|
}
|
|
if (tailcnt) return FNM_NOMATCH;
|
|
if (tailcnt) return FNM_NOMATCH;
|