summaryrefslogtreecommitdiff
path: root/src/io/read.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/read.cpp')
-rw-r--r--src/io/read.cpp5
1 files changed, 4 insertions, 1 deletions
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;
}