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

Fix for ksh emulation



Hi;

We (openSUSE) imported a patch from RHEL to fix ksh emulation problem described in https://bugzilla.redhat.com/show_bug.cgi?id=488943 . I am attaching the patch so hopefully this can go upstream instead of rotting in our tree.

Regards,
ismail


diff -ruN zsh-4.3.12-orig/Src/subst.c zsh-4.3.12/Src/subst.c
--- zsh-4.3.12-orig/Src/subst.c	2011-05-23 18:48:19.000000000 +0200
+++ zsh-4.3.12/Src/subst.c	2011-06-29 13:44:13.000000000 +0200
@@ -245,7 +245,10 @@
 	    if (endchar == Outpar && str2[1] == '(' && str[-2] == ')') {
 		/* Math substitution of the form $((...)) */
 		str[-2] = '\0';
-		str = arithsubst(str2 + 2, &str3, str);
+		if (isset(EXECOPT))
+		    str = arithsubst(str2 + 2, &str3, str);
+		else
+		    strncpy(str3, str2, 1);
 		setdata(node, (void *) str3);
 		continue;
 	    }


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