Source-Changes-HG archive

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

[src/trunk]: src/bin/sh Correct the initial line number used for processing -...



details:   https://anonhg.NetBSD.org/src/rev/199b8d01f5fb
branches:  trunk
changeset: 824799:199b8d01f5fb
user:      kre <kre%NetBSD.org@localhost>
date:      Mon Jun 19 02:49:33 2017 +0000

description:
Correct the initial line number used for processing -c arg strings.

(It was inheriting the value from end of profile file processing) - I didn't
notice before as I usually test with empty or no profile files to avoid
complications.   Trivial change which should have very limited impact.

diffstat:

 bin/sh/main.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r c7ef19ae3f04 -r 199b8d01f5fb bin/sh/main.c
--- a/bin/sh/main.c     Mon Jun 19 02:46:50 2017 +0000
+++ b/bin/sh/main.c     Mon Jun 19 02:49:33 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.70 2017/05/29 14:03:23 kre Exp $    */
+/*     $NetBSD: main.c,v 1.71 2017/06/19 02:49:33 kre Exp $    */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.7 (Berkeley) 7/19/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.70 2017/05/29 14:03:23 kre Exp $");
+__RCSID("$NetBSD: main.c,v 1.71 2017/06/19 02:49:33 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -178,7 +178,7 @@
        opentrace();
        trputs("Shell args:  ");  trargs(argv);
 #if DEBUG >= 3
-       set_debug(((DEBUG)==3 ? "_^" : "++"), 1);
+       set_debug(((DEBUG)==3 ? "_@" : "++"), 1);
 #endif
 #endif
        rootpid = getpid();
@@ -217,6 +217,8 @@
        }
 state3:
        state = 4;
+       line_number = 1;        /* undo anything from profile files */
+
        if (sflag == 0 || minusc) {
                static int sigs[] =  {
                    SIGINT, SIGQUIT, SIGHUP, 



Home | Main Index | Thread Index | Old Index