If an error occurred in /dev/stdin, don't fopen it

This commit is contained in:
John Wiegley 2009-02-27 03:05:35 -04:00
parent c49b98fc4c
commit 501949a364

View file

@ -83,7 +83,7 @@ string source_context(const path& file,
const string& prefix)
{
std::size_t len = end_pos - pos;
if (! len)
if (! len || file == path("/dev/stdin"))
return _("<no source context>");
assert(len > 0);