check whether pattern has no special characters */
| 578 | |
| 579 | /* check whether pattern has no special characters */ |
| 580 | static int nospecials (const char *p, size_t l) { |
| 581 | size_t upto = 0; |
| 582 | do { |
| 583 | if (strpbrk(p + upto, SPECIALS)) |
| 584 | return 0; /* pattern has a special character */ |
| 585 | upto += strlen(p + upto) + 1; /* may have more after \0 */ |
| 586 | } while (upto <= l); |
| 587 | return 1; /* no special chars found */ |
| 588 | } |
| 589 | |
| 590 | |
| 591 | static void prepstate (MatchState *ms, lua_State *L, |