When reporting that a line is too long, include the line number in the

error message.  While I'm here, add a note that the "line too long"
message isn't always accurate.

PR:		35395
Submitted by:	andrew@ugh.net.au
This commit is contained in:
dd 2002-03-09 03:52:14 +00:00
parent fa8475a7f6
commit 165dbb1a74

View File

@ -505,7 +505,11 @@ scan(fp, pw)
* -- The Who * -- The Who
*/ */
if (!(p = strchr(line, '\n'))) { if (!(p = strchr(line, '\n'))) {
warnx("line too long"); /*
* XXX: This may also happen if the last line in a
* file does not have a trailing newline.
*/
warnx("line #%d too long", lcnt);
goto fmt; goto fmt;
} }