Module Name:    src
Committed By:   snj
Date:           Wed Apr 19 17:09:38 UTC 2017

Modified Files:
        src/bin/sh [netbsd-7]: expand.c

Log Message:
Pull up following revision(s) (requested by kre in ticket #1388):
        bin/sh/expand.c: revision 1.102
Fix for the "${unset-var#$(cmd1)}$(cmd2)" runs the wrong command bug.
... From FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.91.4.1 src/bin/sh/expand.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/sh/expand.c
diff -u src/bin/sh/expand.c:1.91 src/bin/sh/expand.c:1.91.4.1
--- src/bin/sh/expand.c:1.91	Mon Jan 20 14:05:51 2014
+++ src/bin/sh/expand.c	Wed Apr 19 17:09:38 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: expand.c,v 1.91 2014/01/20 14:05:51 roy Exp $	*/
+/*	$NetBSD: expand.c,v 1.91.4.1 2017/04/19 17:09:38 snj Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)expand.c	8.5 (Berkeley) 5/15/95";
 #else
-__RCSID("$NetBSD: expand.c,v 1.91 2014/01/20 14:05:51 roy Exp $");
+__RCSID("$NetBSD: expand.c,v 1.91.4.1 2017/04/19 17:09:38 snj Exp $");
 #endif
 #endif /* not lint */
 
@@ -753,8 +753,10 @@ again: /* jump here after setting a vari
 	case VSTRIMLEFTMAX:
 	case VSTRIMRIGHT:
 	case VSTRIMRIGHTMAX:
-		if (!set)
+		if (!set) {
+			set = 1;  /* allow argbackq to be advanced if needed */
 			break;
+		}
 		/*
 		 * Terminate the string and start recording the pattern
 		 * right after it

Reply via email to