diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2002-05-06 14:46:11 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2002-05-06 14:46:11 +0000 |
commit | cefd2de2e181eb4844ccec575322e410e75a1afd (patch) | |
tree | d722f6dd4022e9f9d9414d1f2093d0c6ec9e6368 /Src/glob.c | |
parent | b7aa69cb7db6dfa7d80bcbd1792dc9b312104fca (diff) | |
download | zsh-cefd2de2e181eb4844ccec575322e410e75a1afd.tar.gz zsh-cefd2de2e181eb4844ccec575322e410e75a1afd.tar.xz zsh-cefd2de2e181eb4844ccec575322e410e75a1afd.zip |
Split tokenize() into shtokenize() and zshtokenize()
to improve SH_GLOB handling, particularly in completion
Diffstat (limited to 'Src/glob.c')
-rw-r--r-- | Src/glob.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Src/glob.c b/Src/glob.c index 443262dc4..8caa70ba5 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -2448,6 +2448,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 '^': |