From 79dbcc8382abb6bf947fe5ae237e4bf2ecf1c677 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Fri, 20 Jul 2001 10:54:38 +0000 Subject: don't use compsuffix when it might be freed; use the right variable in that loop there, dammit (15433) --- ChangeLog | 5 +++++ Src/Zle/computil.c | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index b402514e8..9099f92c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-07-20 Sven Wischnowsky + + * 15433: Src/Zle/computil.c: don't use compsuffix when it might + be freed; use the right variable in that loop there, dammit + 2001-07-19 Sven Wischnowsky * 15415: Completion/Base/Utility/_describe, Src/Zle/computil.c: 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; -- cgit 1.4.1