Changeset 832
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/assoc.c
r793 r832 361 361 } 362 362 else 363 exclude = FALSE; 364 didmatch = wildcard((strchr(p, '\\') || 365 strchr(p, ':')) ? datafile : file, p, FALSE); 363 exclude = FALSE; 364 if ((*p == '*') && 365 !((p[strlen(p) - 1]) == '*')) 366 didmatch = wildcard((strchr(p, '\\') || 367 strchr(p, ':')) ? datafile : file, p, FALSE); 368 else 369 didmatch = wildcard2((strchr(p, '\\') || 370 strchr(p, ':')) ? datafile : file, p, FALSE); 366 371 if (exclude && didmatch) 367 372 didmatch = FALSE; -
trunk/dll/avl.c
r806 r832 171 171 &handle, 172 172 &action, 173 0 L,174 0 L,173 0, 174 0, 175 175 OPEN_ACTION_FAIL_IF_NEW | 176 176 OPEN_ACTION_OPEN_IF_EXISTS, … … 178 178 OPEN_FLAGS_NOINHERIT | 179 179 OPEN_FLAGS_RANDOMSEQUENTIAL | 180 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, 0 L))180 OPEN_SHARE_DENYNONE | OPEN_ACCESS_READONLY, 0)) 181 181 return NULL; 182 182 // Scan signatures … … 199 199 if (!DosChgFilePtr(handle, 200 200 abs(info->file_offset), 201 (info->file_offset >= 0 L) ?201 (info->file_offset >= 0) ? 202 202 FILE_BEGIN : FILE_END, &len)) { 203 203 if (!DosRead(handle, buffer, l, &len) && len == l) { -
trunk/dll/filter.c
r793 r832 73 73 || ((mask->antiattr & FILE_DIRECTORY) 74 74 && !(r->attrFile & FILE_DIRECTORY))) 75 return FALSE;75 return FALSE; 76 76 if (*mask->szMask) { 77 if ((*mask->szMask == '*') && 78 !((mask->szMask[strlen(mask->szMask)-1]) == '*')){ 79 file = strrchr(r->pszFileName, '\\'); 80 if (!file) 81 file = strrchr(r->pszFileName, ':'); 82 if (file) 83 file++; 84 else 85 file = r->pszFileName; 86 if (mask->pszMasks[1]) { 87 for (x = 0; mask->pszMasks[x]; x++) { 88 if (*mask->pszMasks[x]) { 89 if (*mask->pszMasks[x] != '/') { 90 if (wildcard((strchr(mask->pszMasks[x], '\\') || 91 strchr(mask->pszMasks[x], ':')) ? 92 r->pszFileName : file, mask->pszMasks[x], FALSE)) 93 ret = TRUE; 94 } 95 else { 96 if (wildcard((strchr(mask->pszMasks[x], '\\') || 97 strchr(mask->pszMasks[x], ':')) ? 98 r->pszFileName : file, mask->pszMasks[x] + 1, 99 FALSE)) { 100 ret = FALSE; 101 break; 102 } 103 } 104 } 105 } 106 } 107 else { 108 if (wildcard((strchr(mask->szMask, '\\') || 109 strchr(mask->szMask, ':')) ? 110 r->pszFileName : file, mask->szMask, FALSE)) 111 ret = TRUE; 112 } 113 } 114 else{ 77 115 file = strrchr(r->pszFileName, '\\'); 78 if (!file) 79 file = strrchr(r->pszFileName, ':'); 80 if (file) 81 file++; 82 else 83 file = r->pszFileName; 84 if (mask->pszMasks[1]) { 85 for (x = 0; mask->pszMasks[x]; x++) { 86 if (*mask->pszMasks[x]) { 87 if (*mask->pszMasks[x] != '/') { 88 if (wildcard((strchr(mask->pszMasks[x], '\\') || 89 strchr(mask->pszMasks[x], ':')) ? 90 r->pszFileName : file, mask->pszMasks[x], FALSE)) 91 ret = TRUE; 92 } 93 else { 94 if (wildcard((strchr(mask->pszMasks[x], '\\') || 95 strchr(mask->pszMasks[x], ':')) ? 96 r->pszFileName : file, mask->pszMasks[x] + 1, 97 FALSE)) { 98 ret = FALSE; 99 break; 100 } 101 } 102 } 103 } 104 } 105 else { 106 if (wildcard((strchr(mask->szMask, '\\') || 107 strchr(mask->szMask, ':')) ? 108 r->pszFileName : file, mask->szMask, FALSE)) 109 ret = TRUE; 110 } 111 } 116 if (!file) 117 file = strrchr(r->pszFileName, ':'); 118 if (file) 119 file++; 120 else 121 file = r->pszFileName; 122 if (mask->pszMasks[1]) { 123 for (x = 0; mask->pszMasks[x]; x++) { 124 if (*mask->pszMasks[x]) { 125 if (*mask->pszMasks[x] != '/') { 126 if (wildcard2((strchr(mask->pszMasks[x], '\\') || 127 strchr(mask->pszMasks[x], ':')) ? 128 r->pszFileName : file, mask->pszMasks[x], FALSE)) 129 ret = TRUE; 130 } 131 else { 132 if (wildcard2((strchr(mask->pszMasks[x], '\\') || 133 strchr(mask->pszMasks[x], ':')) ? 134 r->pszFileName : file, mask->pszMasks[x] + 1, 135 FALSE)) { 136 ret = FALSE; 137 break; 138 } 139 } 140 } 141 } 142 } 143 else { 144 if (wildcard2((strchr(mask->szMask, '\\') || 145 strchr(mask->szMask, ':')) ? 146 r->pszFileName : file, mask->szMask, FALSE)) 147 ret = TRUE; 148 } 149 } 150 } 112 151 else 113 152 ret = TRUE; -
trunk/dll/fm3dll.h
r828 r832 872 872 UINT literal(PSZ pszBuf); 873 873 BOOL wildcard(const PSZ pszBuf, const PSZ pszWildCard, 874 const BOOL fNotFileSpec); 875 BOOL wildcard2(const PSZ pszBuf, const PSZ pszWildCard, 874 876 const BOOL fNotFileSpec); 875 877 PSZ fixup(const PCH pachInBuf, PSZ pszOutBuf, const UINT cBufBytes, -
trunk/dll/literal.c
r795 r832 204 204 const BOOL fNotFileSpec) 205 205 { 206 const CHAR *fstr = pszBuf; 207 PSZ fcard = pszWildCard; 206 207 const CHAR *fstr = strrev(pszBuf); 208 PSZ fcard = strrev(pszWildCard); 208 209 INT wmatch = TRUE; 209 210 210 while (wmatch && *fcard && *fstr) { 211 switch (*fcard) {211 switch (*fcard) { 212 212 case '?': /* character substitution */ 213 213 fcard++; … … 219 219 /* find next non-wild character in wildcard */ 220 220 while (*fcard && (*fcard == '?' || *fcard == '*')) 221 fcard++; 222 if (!*fcard) /* if last char of wildcard is *, it matches */ 221 fcard++; 222 if (!*fcard){ /* if last char of wildcard is *, it matches */ 223 fstr = strrev(pszBuf); 224 fcard = strrev(pszWildCard); 223 225 return TRUE; 226 } 224 227 /* skip until partition, match, or eos */ 225 228 while (*fstr && toupper(*fstr) != toupper(*fcard) && 226 229 (fNotFileSpec || (*fstr != '\\' && 227 *fstr != '/' && *fstr != '.')))230 *fstr != '/' && *fstr != '.'))) 228 231 fstr++; 229 232 if (!fNotFileSpec && !*fstr) /* implicit '.' */ … … 234 237 default: 235 238 if (!fNotFileSpec && ((*fstr == '/' || *fstr == '\\') && 236 (*fcard == '/' || *fcard == '\\')))239 (*fcard == '/' || *fcard == '\\'))) 237 240 wmatch = TRUE; 238 241 else … … 243 246 } 244 247 } 248 if ((*fcard && *fcard != '*') || *fstr){ 249 fstr = strrev(pszBuf); 250 fcard = strrev(pszWildCard); 251 return 0; 252 } 253 else{ 254 fstr = strrev(pszBuf); 255 fcard = strrev(pszWildCard); 256 return wmatch; 257 } 258 } 259 260 BOOL wildcard2(const PSZ pszBuf, const PSZ pszWildCard, 261 const BOOL fNotFileSpec) 262 { 263 const CHAR *fstr = pszBuf; 264 PSZ fcard = pszWildCard; 265 CHAR tcard[50]; 266 INT wmatch = TRUE; 267 268 while (wmatch && *fcard && *fstr) { 269 switch (*fcard) { 270 case '?': /* character substitution */ 271 fcard++; 272 if (fNotFileSpec || (*fstr != '.' && *fstr != '/' && *fstr != '\\')) 273 fstr++; /* skip (match) next character */ 274 break; 275 276 case '*': 277 /* find next non-wild character in wildcard */ 278 while (*fcard && (*fcard == '?' || *fcard == '*')) 279 fcard++; 280 if (!*fcard) /* if last char of wildcard is *, it matches */ 281 return TRUE; 282 /* skip until partition, match, or eos */ 283 while (*fstr && toupper(*fstr) != toupper(*fcard) && 284 (fNotFileSpec || (*fstr != '\\' && 285 *fstr != '/' && *fstr != '.'))) 286 fstr++; 287 if (!fNotFileSpec && !*fstr) /* implicit '.' */ 288 if (*fcard == '.') 289 fcard++; 290 break; 291 292 default: 293 if (!fNotFileSpec && ((*fstr == '/' || *fstr == '\\') && 294 (*fcard == '/' || *fcard == '\\'))) 295 wmatch = TRUE; 296 else 297 wmatch = (toupper(*fstr) == toupper(*fcard)); 298 fstr++; 299 fcard++; 300 break; 301 } 302 } //while 245 303 246 304 if ((*fcard && *fcard != '*') || *fstr) … … 249 307 return wmatch; 250 308 } 309 251 310 252 311 // fixup - quote literal character array … … 298 357 } 299 358 300 #pragma alloc_text(LITERAL,literal,index,fixup,wildcard )301 359 #pragma alloc_text(LITERAL,literal,index,fixup,wildcard, wildcard2) 360
Note:
See TracChangeset
for help on using the changeset viewer.
