From cefd2de2e181eb4844ccec575322e410e75a1afd Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 6 May 2002 14:46:11 +0000 Subject: Split tokenize() into shtokenize() and zshtokenize() to improve SH_GLOB handling, particularly in completion --- Src/glob.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Src/glob.c') diff --git a/Src/glob.c b/Src/glob.c index 443262dc4..8caa70ba5 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -2447,6 +2447,20 @@ igetmatch(char **sp, Patprog p, int fl, int n, char *replstr) /**/ mod_export void tokenize(char *s) +{ + zshtokenize(s, 0); +} + +/**/ +mod_export void +shtokenize(char *s) +{ + zshtokenize(s, isset(SHGLOB)); +} + +/**/ +static void +zshtokenize(char *s, int shglob) { char *t; int bslash = 0; @@ -2463,7 +2477,7 @@ tokenize(char *s) bslash = 1; continue; case '<': - if (isset(SHGLOB)) + if (shglob) break; if (bslash) { s[-1] = Bnull; @@ -2482,7 +2496,7 @@ tokenize(char *s) case '(': case '|': case ')': - if (isset(SHGLOB)) + if (shglob) break; case '>': case '^': -- cgit v1.2.3