Source-Changes-HG archive

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

[src/trunk]: src/bin/sh Remove some left over baggage from the LINENO v1 impl...



details:   https://anonhg.NetBSD.org/src/rev/2d324f3f8942
branches:  trunk
changeset: 824534:2d324f3f8942
user:      kre <kre%NetBSD.org@localhost>
date:      Thu Jun 08 13:12:17 2017 +0000

description:
Remove some left over baggage from the LINENO v1 implementation that
didn't get removed with v2, and should have.   This would have had
(I think, without having tested it) one very minor effect on the way
LINENO worked in the v2 implementation, but my guess is it would have
taken a long time before anyone noticed...

diffstat:

 bin/sh/eval.c    |  16 ++--------------
 bin/sh/nodetypes |   3 +--
 bin/sh/parser.c  |   5 ++---
 3 files changed, 5 insertions(+), 19 deletions(-)

diffs (94 lines):

diff -r 467c6bded895 -r 2d324f3f8942 bin/sh/eval.c
--- a/bin/sh/eval.c     Thu Jun 08 13:05:03 2017 +0000
+++ b/bin/sh/eval.c     Thu Jun 08 13:12:17 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eval.c,v 1.145 2017/06/08 02:25:43 kre Exp $   */
+/*     $NetBSD: eval.c,v 1.146 2017/06/08 13:12:17 kre Exp $   */
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c     8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.145 2017/06/08 02:25:43 kre Exp $");
+__RCSID("$NetBSD: eval.c,v 1.146 2017/06/08 13:12:17 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -117,7 +117,6 @@
 STATIC void evalpipe(union node *);
 STATIC void evalcommand(union node *, int, struct backcmd *);
 STATIC void prehash(union node *);
-STATIC void set_lineno(int);
 
 STATIC char *find_dot_file(char *);
 
@@ -309,11 +308,9 @@
                evalloop(n, sflags);
                break;
        case NFOR:
-               set_lineno(n->nfor.lineno);
                evalfor(n, sflags);
                break;
        case NCASE:
-               set_lineno(n->ncase.lineno);
                evalcase(n, sflags);
                break;
        case NDEFUN:
@@ -1492,12 +1489,3 @@
 
        return 0;
 }
-
-STATIC void
-set_lineno(int lno)
-{
-       char lineno[24];
-
-       (void)snprintf(lineno, sizeof lineno, "%u", lno);
-       (void)setvarsafe("LINENO", lineno, 0);
-}
diff -r 467c6bded895 -r 2d324f3f8942 bin/sh/nodetypes
--- a/bin/sh/nodetypes  Thu Jun 08 13:05:03 2017 +0000
+++ b/bin/sh/nodetypes  Thu Jun 08 13:12:17 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: nodetypes,v 1.17 2017/06/07 05:08:32 kre Exp $
+#      $NetBSD: nodetypes,v 1.18 2017/06/08 13:12:17 kre Exp $
 # Copyright (c) 1991, 1993
 #      The Regents of the University of California.  All rights reserved.
 #
@@ -90,7 +90,6 @@
        args      nodeptr               # for var in args
        body      nodeptr               # do body; done
        var       string                # the for variable
-       lineno    int
 
 NCASE ncase                    # a case statement
        type      int
diff -r 467c6bded895 -r 2d324f3f8942 bin/sh/parser.c
--- a/bin/sh/parser.c   Thu Jun 08 13:05:03 2017 +0000
+++ b/bin/sh/parser.c   Thu Jun 08 13:12:17 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parser.c,v 1.135 2017/06/07 08:10:31 kre Exp $ */
+/*     $NetBSD: parser.c,v 1.136 2017/06/08 13:12:17 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.135 2017/06/07 08:10:31 kre Exp $");
+__RCSID("$NetBSD: parser.c,v 1.136 2017/06/08 13:12:17 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -406,7 +406,6 @@
                n1 = stalloc(sizeof(struct nfor));
                n1->type = NFOR;
                n1->nfor.var = wordtext;
-               n1->nfor.lineno = startlinno;
                if (readtoken()==TWORD && !quoteflag && equal(wordtext,"in")) {
                        app = &ap;
                        while (readtoken() == TWORD) {



Home | Main Index | Thread Index | Old Index