diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-07-20 10:54:38 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2001-07-20 10:54:38 +0000 |
commit | 79dbcc8382abb6bf947fe5ae237e4bf2ecf1c677 (patch) | |
tree | 8e57222c4462db60862a73e2300b1e425272b0ba /Src/Zle | |
parent | facff10b116622e8cb409d5b1aa6eaa7574f949d (diff) | |
download | zsh-79dbcc8382abb6bf947fe5ae237e4bf2ecf1c677.tar.gz zsh-79dbcc8382abb6bf947fe5ae237e4bf2ecf1c677.tar.xz zsh-79dbcc8382abb6bf947fe5ae237e4bf2ecf1c677.zip |
don't use compsuffix when it might be freed; use the right variable in that loop there, dammit (15433)
Diffstat (limited to 'Src/Zle')
-rw-r--r-- | Src/Zle/computil.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index 299f3ca98..5c4fc3ed5 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -2615,19 +2615,21 @@ cv_parse_word(Cvdef d) ign = strlen(as); } } + more = dupstring(more); + if (ign) ignore_suffix(ign); while (more && *more) { - if ((val = cv_next(d, &str, &arg))) { + if ((val = cv_next(d, &more, &arg))) { zaddlinknode(state.vals, ztrdup(val->name)); if (arg) { - if (str) { - char sav = str[-1]; + if (more) { + char sav = more[-1]; - str[-1] = '\0'; + more[-1] = '\0'; zaddlinknode(state.vals, ztrdup(arg)); - str[-1] = sav; + more[-1] = sav; } else { zaddlinknode(state.vals, tricat(arg, compsuffix, "")); nosfx = 1; |