Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/bin/sh Fix the heredoc line counting bug that I caused when ...
details: https://anonhg.NetBSD.org/src/rev/7e117eb7d4e9
branches: trunk
changeset: 353406:7e117eb7d4e9
user: kre <kre%NetBSD.org@localhost>
date: Wed May 03 21:36:16 2017 +0000
description:
Fix the heredoc line counting bug that I caused when the heredoc
processing was changed just over a year ago (rev 1.111).
diffstat:
bin/sh/parser.c | 19 ++++++++++++-------
1 files changed, 12 insertions(+), 7 deletions(-)
diffs (52 lines):
diff -r 774cd80a39e1 -r 7e117eb7d4e9 bin/sh/parser.c
--- a/bin/sh/parser.c Wed May 03 21:34:51 2017 +0000
+++ b/bin/sh/parser.c Wed May 03 21:36:16 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parser.c,v 1.121 2017/05/03 04:51:04 kre Exp $ */
+/* $NetBSD: parser.c,v 1.122 2017/05/03 21:36:16 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.121 2017/05/03 04:51:04 kre Exp $");
+__RCSID("$NetBSD: parser.c,v 1.122 2017/05/03 21:36:16 kre Exp $");
#endif
#endif /* not lint */
@@ -806,8 +806,10 @@
* for the epfmark - everything saved literally.
*/
STPUTC(c, out);
- if (c == '\n')
+ if (c == '\n') {
+ plinno++;
break;
+ }
continue;
}
/*
@@ -822,14 +824,17 @@
*/
if (c == '\\') { /* A backslash */
c = pgetc(); /* followed by */
- if (c == '\n') /* a newline? */
- continue; /* y:drop both */
+ if (c == '\n') { /* a newline? */
+ plinno++;
+ continue; /* :drop both */
+ }
STPUTC('\\', out); /* else keep \ */
}
STPUTC(c, out); /* keep the char */
- if (c == '\n') /* at end of line */
+ if (c == '\n') { /* at end of line */
+ plinno++;
break; /* look for eofmark */
-
+ }
} while ((c = pgetc()) != PEOF);
/*
Home |
Main Index |
Thread Index |
Old Index