Source-Changes-HG archive

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

[src/trunk]: src/bin/sh When we record an arithmetic expression ($(( ))) as b...



details:   https://anonhg.NetBSD.org/src/rev/fb075caffefa
branches:  trunk
changeset: 824389:fb075caffefa
user:      kre <kre%NetBSD.org@localhost>
date:      Sat Jun 03 18:31:35 2017 +0000

description:
When we record an arithmetic expression ($(( ))) as being quoted,
what matters is the quoting state just before we switch into arithmetic
syntax parsing mode, not the state after...

This fixes the regiression introduced earlier today (UTC) where
quoted arithmetic expressions were being subjected to word splitting.

diffstat:

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

diffs (40 lines):

diff -r 437e92a53470 -r fb075caffefa bin/sh/parser.c
--- a/bin/sh/parser.c   Sat Jun 03 17:05:23 2017 +0000
+++ b/bin/sh/parser.c   Sat Jun 03 18:31:35 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parser.c,v 1.131 2017/06/03 10:31:16 kre Exp $ */
+/*     $NetBSD: parser.c,v 1.132 2017/06/03 18:31:35 kre Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)parser.c   8.7 (Berkeley) 5/16/95";
 #else
-__RCSID("$NetBSD: parser.c,v 1.131 2017/06/03 10:31:16 kre Exp $");
+__RCSID("$NetBSD: parser.c,v 1.132 2017/06/03 18:31:35 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -1919,17 +1919,16 @@
        } else
 #endif
        {
-               TS_PUSH();
-               syntax = ARISYNTAX;
-               arinest = 1;
-               varnest = 0;
-
                USTPUTC(CTLARI, out);
                if (ISDBLQUOTE())
                        USTPUTC('"',out);
                else
                        USTPUTC(' ',out);
 
+               TS_PUSH();
+               syntax = ARISYNTAX;
+               arinest = 1;
+               varnest = 0;
        }
        goto parsearith_return;
 }



Home | Main Index | Thread Index | Old Index