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...
This commit is contained in:
kre 2017-06-08 13:12:17 +00:00
parent 5650ad4363
commit 15de6ce7d7
3 changed files with 5 additions and 19 deletions

View File

@ -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);
}

View File

@ -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

View File

@ -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) {