- if (dot_special && *str == '.' && *pattern != *str)
- return FALSE;
-
- while ((*pattern != '\0') && (!done)
- && (((*str=='\0')&&((*pattern==OB)||(*pattern=='*')))||(*str!='\0'))) {
- switch (*pattern) {
- case '\\':
- pattern++;
- if (*pattern != '\0')
- pattern++;
- break;
- case '*':
- pattern++;
- ret_code = FALSE;
- while ((*str!='\0')
- && (!(ret_code=wxMatchWild(pattern, str++, FALSE))))
- /*loop*/;
- if (ret_code) {
- while (*str != '\0')
- str++;
- while (*pattern != '\0')
- pattern++;
- }
- break;
- case '[':
- pattern++;
- repeat:
- if ((*pattern == '\0') || (*pattern == ']')) {
- done = TRUE;
- break;
- }
- if (*pattern == '\\') {
- pattern++;
- if (*pattern == '\0') {
- done = TRUE;
- break;
- }
- }
- if (*(pattern + 1) == '-') {
- c = *pattern;
- pattern += 2;
- if (*pattern == ']') {
- done = TRUE;
- break;
- }
- if (*pattern == '\\') {
- pattern++;
- if (*pattern == '\0') {
- done = TRUE;
- break;
- }
- }
- if ((*str < c) || (*str > *pattern)) {
- pattern++;
- goto repeat;
- }
- } else if (*pattern != *str) {
- pattern++;
- goto repeat;
- }
- pattern++;
- while ((*pattern != ']') && (*pattern != '\0')) {
- if ((*pattern == '\\') && (*(pattern + 1) != '\0'))
- pattern++;
- pattern++;
- }
- if (*pattern != '\0') {
- pattern++, str++;
- }
- break;
- case '?':
- pattern++;
- str++;
- break;
- case OB:
- pattern++;
- while ((*pattern != CB) && (*pattern != '\0')) {
- cp = str;
- ok = TRUE;
- while (ok && (*cp != '\0') && (*pattern != '\0')
- && (*pattern != ',') && (*pattern != CB)) {
- if (*pattern == '\\')
- pattern++;
- ok = (*pattern++ == *cp++);
- }
- if (*pattern == '\0') {
- ok = FALSE;
- done = TRUE;
- break;
- } else if (ok) {
- str = cp;
- while ((*pattern != CB) && (*pattern != '\0')) {
- if (*++pattern == '\\') {
- if (*++pattern == CB)
- pattern++;
- }
- }
- } else {
- while (*pattern!=CB && *pattern!=',' && *pattern!='\0') {
- if (*++pattern == '\\') {
- if (*++pattern == CB || *pattern == ',')
- pattern++;
- }
- }
- }
- if (*pattern != '\0')
- pattern++;
- }
- break;
- default:
- if (*str == *pattern) {
- str++, pattern++;
- } else {
- done = TRUE;
- }
- }
+ if (dot_special && *str == _T('.') && *pattern != *str)
+ return FALSE;
+
+ while ((*pattern != _T('\0')) && (!done)
+ && (((*str==_T('\0'))&&((*pattern==OB)||(*pattern==_T('*'))))||(*str!=_T('\0')))) {
+ switch (*pattern) {
+ case _T('\\'):
+ pattern++;
+ if (*pattern != _T('\0'))
+ pattern++;
+ break;
+ case _T('*'):
+ pattern++;
+ ret_code = FALSE;
+ while ((*str!=_T('\0'))
+ && (!(ret_code=wxMatchWild(pattern, str++, FALSE))))
+ /*loop*/;
+ if (ret_code) {
+ while (*str != _T('\0'))
+ str++;
+ while (*pattern != _T('\0'))
+ pattern++;
+ }
+ break;
+ case _T('['):
+ pattern++;
+ repeat:
+ if ((*pattern == _T('\0')) || (*pattern == _T(']'))) {
+ done = TRUE;
+ break;
+ }
+ if (*pattern == _T('\\')) {
+ pattern++;
+ if (*pattern == _T('\0')) {
+ done = TRUE;
+ break;
+ }
+ }
+ if (*(pattern + 1) == _T('-')) {
+ c = *pattern;
+ pattern += 2;
+ if (*pattern == _T(']')) {
+ done = TRUE;
+ break;
+ }
+ if (*pattern == _T('\\')) {
+ pattern++;
+ if (*pattern == _T('\0')) {
+ done = TRUE;
+ break;
+ }
+ }
+ if ((*str < c) || (*str > *pattern)) {
+ pattern++;
+ goto repeat;
+ }
+ } else if (*pattern != *str) {
+ pattern++;
+ goto repeat;
+ }
+ pattern++;
+ while ((*pattern != _T(']')) && (*pattern != _T('\0'))) {
+ if ((*pattern == _T('\\')) && (*(pattern + 1) != _T('\0')))
+ pattern++;
+ pattern++;
+ }
+ if (*pattern != _T('\0')) {
+ pattern++, str++;
+ }
+ break;
+ case _T('?'):
+ pattern++;
+ str++;
+ break;
+ case OB:
+ pattern++;
+ while ((*pattern != CB) && (*pattern != _T('\0'))) {
+ cp = str;
+ ok = TRUE;
+ while (ok && (*cp != _T('\0')) && (*pattern != _T('\0'))
+ && (*pattern != _T(',')) && (*pattern != CB)) {
+ if (*pattern == _T('\\'))
+ pattern++;
+ ok = (*pattern++ == *cp++);
+ }
+ if (*pattern == _T('\0')) {
+ ok = FALSE;
+ done = TRUE;
+ break;
+ } else if (ok) {
+ str = cp;
+ while ((*pattern != CB) && (*pattern != _T('\0'))) {
+ if (*++pattern == _T('\\')) {
+ if (*++pattern == CB)
+ pattern++;
+ }
+ }
+ } else {
+ while (*pattern!=CB && *pattern!=_T(',') && *pattern!=_T('\0')) {
+ if (*++pattern == _T('\\')) {
+ if (*++pattern == CB || *pattern == _T(','))
+ pattern++;
+ }
+ }
+ }
+ if (*pattern != _T('\0'))
+ pattern++;
+ }
+ break;
+ default:
+ if (*str == *pattern) {
+ str++, pattern++;
+ } else {
+ done = TRUE;
+ }
+ }