- Fix bug where the first line after a conditionally skipped was not ready

in its entirety if it contained a continuation.
- Print the whole error line, not just the first 20 characters of it.
This commit is contained in:
christos 1996-09-13 04:22:09 +00:00
parent bfd321ca95
commit 453e90716c
1 changed files with 14 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: parse.c,v 1.24 1996/08/13 16:42:13 christos Exp $ */
/* $NetBSD: parse.c,v 1.25 1996/09/13 04:22:09 christos Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)parse.c 5.18 (Berkeley) 2/19/91";
#else
static char rcsid[] = "$NetBSD: parse.c,v 1.24 1996/08/13 16:42:13 christos Exp $";
static char rcsid[] = "$NetBSD: parse.c,v 1.25 1996/09/13 04:22:09 christos Exp $";
#endif
#endif /* not lint */
@ -2017,8 +2017,7 @@ ParseSkipLine(skip)
* special char.
*/
while ((c != '.') && (c != EOF)) {
while (((c != '\n') || (lastc == '\\')) && (c != EOF))
{
while (((c != '\n') || (lastc == '\\')) && (c != EOF)) {
/*
* Advance to next unescaped newline
*/
@ -2044,10 +2043,18 @@ ParseSkipLine(skip)
*/
buf = Buf_Init (MAKE_BSIZE);
if (c != '\n') {
lastc = '\0';
do {
Buf_AddByte (buf, (Byte)c);
if (lastc != '\0' && lastc != '\n')
Buf_AddByte (buf, (Byte) lastc);
if ((lastc = c) == '\n')
lineno++;
c = ParseReadc();
} while ((c != '\n') && (c != EOF));
if (c == '\n' && lastc == '\\')
lastc = '\0';
} while (((c != '\n') || (lastc == '\0')) && (c != EOF));
if (lastc != '\0' && lastc != '\n')
Buf_AddByte (buf, (Byte) lastc);
}
lineno++;
@ -2434,7 +2441,7 @@ Parse_File(name, stream)
continue;
} else {
Parse_Error (PARSE_FATAL,
"Unassociated shell command \"%.20s\"",
"Unassociated shell command \"%s\"",
cp);
}
}