[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: system/3557: ci(1) throws error when it sees "\ No newline at end of file" from diff
- To: bugs_(_at_)_cvs_(_dot_)_openbsd_(_dot_)_org
- Subject: Re: system/3557: ci(1) throws error when it sees "\ No newline at end of file" from diff
- From: "Todd C. Miller" <Todd_(_dot_)_Miller_(_at_)_courtesan_(_dot_)_com>
- Date: Thu, 6 Nov 2003 19:15:01 -0700 (MST)
- Cc:
- Reply-to: "Todd C. Miller" <Todd_(_dot_)_Miller_(_at_)_courtesan_(_dot_)_com>
The following reply was made to PR system/3557; it has been noted by GNATS.
From: "Todd C. Miller" <Todd_(_dot_)_Miller_(_at_)_courtesan_(_dot_)_com>
To: corlette_(_at_)_ishi_(_dot_)_arp_(_dot_)_harvard_(_dot_)_edu
Cc: gnats_(_at_)_openbsd_(_dot_)_org
Subject: Re: system/3557: ci(1) throws error when it sees "\ No newline at end of file" from diff
Date: Thu, 06 Nov 2003 18:53:16 -0700
The following change make diff closely match the GNU diff behavior.
- todd
Index: diffreg.c
===================================================================
RCS file: /cvs/src/usr.bin/diff/diffreg.c,v
retrieving revision 1.51
diff -u -r1.51 diffreg.c
--- diffreg.c 28 Oct 2003 13:23:59 -0000 1.51
+++ diffreg.c 7 Nov 2003 01:54:10 -0000
@@ -1119,8 +1119,12 @@
col = 0;
for (j = 0, lastc = '\0'; j < nc; j++, lastc = c) {
if ((c = getc(lb)) == EOF) {
- puts("\n\\ No newline at end of file");
- return (0);;
+ if (format == D_EDIT || format == D_REVERSE ||
+ format == D_NREVERSE)
+ warnx("No newline at end of file");
+ else
+ puts("\n\\ No newline at end of file");
+ return (0);
}
if (c == '\t' && tflag) {
do {
Visit your host, monkey.org