Changeset 904
- Timestamp:
- 06/09/07 11:02:27 (1 year ago)
- Files:
-
- 1.8.2/branches/devel/src/wild.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.2/branches/devel/src/wild.c
r902 r904 468 468 469 469 /** Wildcard match, possibly case-sensitive, and remember the wild data 470 * in global_eval_context.wnxt.470 * in matches, storing them in data. 471 471 * 472 472 * This routine will cause crashes if fed NULLs instead of strings. … … 486 486 int 487 487 wild_match_case_r(const char *RESTRICT s, const char *RESTRICT d, int cs, 488 char **ary, int max, char *data, int len) 489 { 490 /* Clear %0-%9 and r(0) - r(9) */ 491 return wild(s, d, 0, cs, ary, max, data, len); 488 char **matches, int nmatches, char *data, int len) 489 { 490 int n; 491 492 for (n = 0; n < nmatches; n++) 493 matches[n] = NULL; 494 495 return wild(s, d, 0, cs, matches, nmatches, data, len); 492 496 } 493 497 … … 520 524 int subpatterns; 521 525 526 for (i = 0; i < nmatches; i++) 527 matches[i] = NULL; 528 522 529 if ((re = pcre_compile(s, (cs ? 0 : PCRE_CASELESS), &errptr, &erroffset, 523 530 tables)) == NULL) { … … 553 560 */ 554 561 555 for (i = 0; i < nmatches && len > 1; i++) {562 for (i = 0; i < nmatches && i < subpatterns && len > 1; i++) { 556 563 int sublen; 557 564 const char *submatch;
