Module Name: src
Committed By: kre
Date: Thu Jun 8 13:12:17 UTC 2017
Modified Files:
src/bin/sh: eval.c nodetypes parser.c
Log Message:
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...
To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/bin/sh/eval.c
cvs rdiff -u -r1.17 -r1.18 src/bin/sh/nodetypes
cvs rdiff -u -r1.135 -r1.136 src/bin/sh/parser.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.145 src/bin/sh/eval.c:1.146
--- src/bin/sh/eval.c:1.145 Thu Jun 8 02:25:43 2017
+++ src/bin/sh/eval.c Thu Jun 8 13:12:17 2017
@@ -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 expredir(union node *);
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 @@ evaltree(union node *n, int flags)
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 @@ timescmd(int argc, char **argv)
return 0;
}
-
-STATIC void
-set_lineno(int lno)
-{
- char lineno[24];
-
- (void)snprintf(lineno, sizeof lineno, "%u", lno);
- (void)setvarsafe("LINENO", lineno, 0);
-}
Index: src/bin/sh/nodetypes
diff -u src/bin/sh/nodetypes:1.17 src/bin/sh/nodetypes:1.18
--- src/bin/sh/nodetypes:1.17 Wed Jun 7 05:08:32 2017
+++ src/bin/sh/nodetypes Thu Jun 8 13:12:17 2017
@@ -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 @@ NFOR nfor # the for statement
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
Index: src/bin/sh/parser.c
diff -u src/bin/sh/parser.c:1.135 src/bin/sh/parser.c:1.136
--- src/bin/sh/parser.c:1.135 Wed Jun 7 08:10:31 2017
+++ src/bin/sh/parser.c Thu Jun 8 13:12:17 2017
@@ -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 @@ command(void)
n1 = stalloc(sizeof(struct nfor));
n1->type = NFOR;
n1->nfor.var = wordtext;
- n1->nfor.lineno = startlinno;
if (readtoken()==TWORD && !quoteflag && equal(wordtext,"in")) {
app = ≈
while (readtoken() == TWORD) {