Don't attempt to canonicalize '<stdin>'

This little beauty would cause an assertion failure in GetCanonicalName:

  printf "#include <stdio.h>" | include-what-you-use -c -x c -

Special-case '<stdin>' like we do with '<built-in>'.

Fixes issue #1105.
This commit is contained in:
Kim Gräsman 2022-09-09 20:14:33 +02:00
parent 3db4d4ae02
commit c685e46c4e
1 changed files with 1 additions and 1 deletions

View File

@ -86,7 +86,7 @@ string Basename(const string& path) {
string GetCanonicalName(string file_path) {
// For this special 'path' we just return it.
// Note that we leave the 'quotes' to make it different from regular paths.
if (file_path == "<built-in>")
if (file_path == "<built-in>" || file_path == "<stdin>")
return file_path;
CHECK_(!IsQuotedInclude(file_path));