summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/rcs.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cvs/src/rcs.c')
-rw-r--r--contrib/cvs/src/rcs.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/cvs/src/rcs.c b/contrib/cvs/src/rcs.c
index 8be6ea4..a49c449 100644
--- a/contrib/cvs/src/rcs.c
+++ b/contrib/cvs/src/rcs.c
@@ -1048,8 +1048,13 @@ getrcsrev (fp, revp)
do {
c = getc (fp);
if (c == EOF)
+ {
/* FIXME: should be including filename in error message. */
- error (1, errno, "cannot read rcs file");
+ if (ferror (fp))
+ error (1, errno, "cannot read rcs file");
+ else
+ error (1, 0, "unexpected end of file reading rcs file");
+ }
} while (whitespace (c));
if (!(isdigit (c) || c == '.'))
@@ -1073,7 +1078,10 @@ getrcsrev (fp, revp)
if (c == EOF)
{
/* FIXME: should be including filename in error message. */
- error (1, errno, "cannot read rcs file");
+ if (ferror (fp))
+ error (1, errno, "cannot read rcs file");
+ else
+ error (1, 0, "unexpected end of file reading rcs file");
}
}
OpenPOWER on IntegriCloud