[hackers] [sbase][PATCH 1/3] ed: Correct error message when open file

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Fri, 1 Jan 2016 17:40:32 +0100

"input/output" error was to general and could create confusion.
All the other ed implementations give a "cannot open input file"
---
 ed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
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) {
-- 
2.1.4
Received on Fri Jan 01 2016 - 17:40:32 CET

This archive was generated by hypermail 2.3.0 : Fri Jan 01 2016 - 17:48:18 CET