[hackers] [sbase] ed: Correct error message when open file || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sat, 2 Jan 2016 10:47:09 +0100 (CET)

commit b2ef7e73e007952fc1a4af00d353d51b77587b57
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Jan 1 17:40:32 2016 +0100
Commit: sin <sin_AT_2f30.org>
CommitDate: Sat Jan 2 09:46:48 2016 +0000

    ed: Correct error message when open file
    
    "input/output" error was to general and could create confusion.
    All the other ed implementations give a "cannot open input file"

diff --git a/ed.c b/ed.c
index 7e7fbb6..96cfc3b 100644
--- a/ed.c
+++ b/ed.c
_AT_@ -609,8 +609,8 @@ doread(char *fname)
 
         if (fp)
                 fclose(fp);
- if (!(fp = fopen(fname, "r")))
- error("input/output error");
+ if ((fp = fopen(fname, "r")) == NULL)
+ error("cannot open input file");
 
         curln = line2;
         for (cnt = 0; (n = getline(&s, &len, fp)) > 0; cnt += (size_t)n) {
Received on Sat Jan 02 2016 - 10:47:09 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 02 2016 - 10:48:13 CET