From c685e46c4e45696d8b029f1849682660dc043a72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kim=20Gr=C3=A4sman?= Date: Fri, 9 Sep 2022 20:14:33 +0200 Subject: [PATCH] Don't attempt to canonicalize '' This little beauty would cause an assertion failure in GetCanonicalName: printf "#include " | include-what-you-use -c -x c - Special-case '' like we do with ''. Fixes issue #1105. --- iwyu_path_util.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iwyu_path_util.cc b/iwyu_path_util.cc index 9987ea4..b63a5c0 100644 --- a/iwyu_path_util.cc +++ b/iwyu_path_util.cc @@ -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 == "") + if (file_path == "" || file_path == "") return file_path; CHECK_(!IsQuotedInclude(file_path));