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:
Dima Dorfman 2002-03-09 03:52:14 +00:00
parent 44f7d6af24
commit 524a875c78
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=91923

View File

@ -505,7 +505,11 @@ scan(fp, pw)
* -- The Who
*/
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;
}