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 exit from running off the end of the input fi...



details:   https://anonhg.NetBSD.org/src/rev/136bd98f10a3
branches:  trunk
changeset: 447625:136bd98f10a3
user:      kre <kre%NetBSD.org@localhost>
date:      Sat Jan 19 14:20:22 2019 +0000

description:
When we exit from running off the end of the input file (which
includes typing ^D) make sure LINENO is set to indicate the last
(actually one past last) line in the input file, rather than
whatever it was set to by the last command that was actually
executed (which could be some line in a function defined in
some other file).

No effect on exit via an explicit exit command - that would already
set the line number correctly.

diffstat:

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

diffs (26 lines):

diff -r f6e79244221e -r 136bd98f10a3 bin/sh/main.c
--- a/bin/sh/main.c     Sat Jan 19 13:27:12 2019 +0000
+++ b/bin/sh/main.c     Sat Jan 19 14:20:22 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.79 2018/12/11 13:31:20 kre Exp $    */
+/*     $NetBSD: main.c,v 1.80 2019/01/19 14:20:22 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.79 2018/12/11 13:31:20 kre Exp $");
+__RCSID("$NetBSD: main.c,v 1.80 2019/01/19 14:20:22 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -248,6 +248,7 @@
 #if PROFILE
        monitor(0);
 #endif
+       line_number = plinno;
        exitshell(exitstatus);
        /* NOTREACHED */
 }



Home | Main Index | Thread Index | Old Index