From 1853e964e96c41e762ca0ab97259ee4e79d86ec7 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 3 Nov 2014 13:35:54 -0800 Subject: Use the new ASTs --- src/io/read.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/io') diff --git a/src/io/read.cpp b/src/io/read.cpp index d701c7f..32974d6 100644 --- a/src/io/read.cpp +++ b/src/io/read.cpp @@ -118,6 +118,7 @@ namespace io } bool ReadFile::getline(AString& line) { + bool was_real_file = fd != FD(); MString tmp; char c; bool anything = false; @@ -151,8 +152,10 @@ namespace io else FPRINTF(stderr, "warning: file contains bare CR\n"_fmt); } - else if (!happy && anything) + else if (!happy && anything && was_real_file) + { FPRINTF(stderr, "warning: file does not contain a trailing newline\n"_fmt); + } line = AString(tmp); return anything; } -- cgit v1.2.3-70-g09d2