diff options
author | Tim Harder <radhermit@gentoo.org> | 2013-03-12 21:47:40 +0000 |
---|---|---|
committer | Tim Harder <radhermit@gentoo.org> | 2013-03-12 21:47:40 +0000 |
commit | 8084b62f22f77ba868576cfa48ea040d1c6c7712 (patch) | |
tree | 2e53ffc8e9e4cc4e8582651d2425bf424f90fc59 /app-shells/zsh/files | |
parent | Mask USE="cg" since it is a toolkit for nvidia binary drivers. (diff) | |
download | gentoo-2-8084b62f22f77ba868576cfa48ea040d1c6c7712.tar.gz gentoo-2-8084b62f22f77ba868576cfa48ea040d1c6c7712.tar.bz2 gentoo-2-8084b62f22f77ba868576cfa48ea040d1c6c7712.zip |
Revbump to fix parameter modifier crash with :wq on empty string.
(Portage version: 2.2.0_alpha166/cvs/Linux x86_64, signed Manifest commit with key 4AB3E85B4F064CA3)
Diffstat (limited to 'app-shells/zsh/files')
-rw-r--r-- | app-shells/zsh/files/zsh-fix-parameter-modifier-crash.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/app-shells/zsh/files/zsh-fix-parameter-modifier-crash.patch b/app-shells/zsh/files/zsh-fix-parameter-modifier-crash.patch new file mode 100644 index 000000000000..1e1847a60ede --- /dev/null +++ b/app-shells/zsh/files/zsh-fix-parameter-modifier-crash.patch @@ -0,0 +1,57 @@ +From 44757a653cb547ae7b556e8c92629d296d3c1f12 Mon Sep 17 00:00:00 2001 +From: Peter Stephenson <pws@users.sourceforge.net> +Date: Tue, 22 Jan 2013 16:28:58 +0000 +Subject: [PATCH] 30993: fix parameter modifier crash with :wq on empty string + +--- + ChangeLog | 8 +++++++- + Src/subst.c | 10 +++++++++- + Test/D04parameter.ztst | 7 +++++++ + 3 files changed, 23 insertions(+), 2 deletions(-) + +diff --git a/Src/subst.c b/Src/subst.c +index 974a845..a4df256 100644 +--- a/Src/subst.c ++++ b/Src/subst.c +@@ -3707,6 +3707,11 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags) + char *y; + + x = val; ++ if (!x) { ++ /* Shouldn't have got here with a NULL string. */ ++ DPUTS(1, "value is NULL in paramsubst"); ++ return NULL; ++ } + if (prenum || postnum) + x = dopadding(x, prenum, postnum, preone, postone, + premul, postmul +@@ -4021,7 +4026,10 @@ modify(char **str, char **ptr) + all = tmp; + t = e; + } +- *str = all; ++ if (!all) ++ *str = dupstring(""); ++ else ++ *str = all; + + } else { + switch (c) { +diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst +index 01f8412..bea9459 100644 +--- a/Test/D04parameter.ztst ++++ b/Test/D04parameter.ztst +@@ -1544,3 +1544,10 @@ + 0:Regression test for shwordsplit with null or unset IFS and quoted array + >abc + >a b c ++ ++ foo= ++ print ${foo:wq} ++ print ${:wq} ++0:Empty parameter shouldn't cause modifiers to crash the shell ++> ++> +-- +1.8.1.5 + |