Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh PR/15579: Alan Barrett: }'s inside variable specs wer...



details:   https://anonhg.NetBSD.org/src/rev/a6e7462e2241
branches:  trunk
changeset: 522142:a6e7462e2241
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Feb 11 18:57:19 2002 +0000

description:
PR/15579: Alan Barrett: }'s inside variable specs were taken into account
even if quoted:
    foo=${foo:-"'{}'"}; echo $foo
would display '{'} instead of '{}'.

diffstat:

 bin/sh/parser.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r e832091ad343 -r a6e7462e2241 bin/sh/parser.c
--- a/bin/sh/parser.c   Mon Feb 11 18:55:16 2002 +0000
+++ b/bin/sh/parser.c   Mon Feb 11 18:57:19 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parser.c,v 1.48 2001/11/02 23:49:14 christos Exp $     */
+/*     $NetBSD: parser.c,v 1.49 2002/02/11 18:57:19 christos Exp $     */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)parser.c   8.7 (Berkeley) 5/16/95";
 #else
-__RCSID("$NetBSD: parser.c,v 1.48 2001/11/02 23:49:14 christos Exp $");
+__RCSID("$NetBSD: parser.c,v 1.49 2002/02/11 18:57:19 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -1006,7 +1006,7 @@
                                PARSESUB();             /* parse substitution */
                                break;
                        case CENDVAR:   /* '}' */
-                               if (varnest > 0) {
+                               if (varnest > 0 && !dblquote) {
                                        varnest--;
                                        USTPUTC(CTLENDVAR, out);
                                } else {



Home | Main Index | Thread Index | Old Index