Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: dupstring a possibly readonly string before modifying



---
 Src/cond.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Src/cond.c b/Src/cond.c
index a63841234d..b9a47cea54 100644
--- a/Src/cond.c
+++ b/Src/cond.c
@@ -139,7 +139,7 @@ evalcond(Estate state, char *fromtest)
 		l = 2;
 	    }
 	    if (name && IS_DASH(name[0]))
-		untokenize(errname = name);
+		untokenize(errname = dupstring(name));
 	    else if (strs[0] && IS_DASH(*strs[0]))
 		untokenize(errname = strs[0]);
 	    else
-- 
2.8.2



Messages sorted by: Reverse Date, Date, Thread, Author