diff --git a/lib/clangimport.cpp b/lib/clangimport.cpp index 805741fd0..a0d2bba55 100644 --- a/lib/clangimport.cpp +++ b/lib/clangimport.cpp @@ -509,7 +509,7 @@ void clangimport::AstNode::setLocations(TokenList *tokenList, int file, int line } else if (ext[0] == '<') { const std::string::size_type colon = ext.find(':'); if (colon != std::string::npos) { - const bool windowsPath = colon == 2 && ext.size() > 4 && ext[3] == '\\'; + const bool windowsPath = colon == 2 && ext.size() > 3 && ext[2] == ':'; const std::string::size_type sep1 = windowsPath ? ext.find(':', 4) : colon; const std::string::size_type sep2 = ext.find(':', sep1 + 1); file = tokenList->appendFileIfNew(ext.substr(1, sep1 - 1)); diff --git a/test/testclangimport.cpp b/test/testclangimport.cpp index f92b8ef98..e301c41db 100644 --- a/test/testclangimport.cpp +++ b/test/testclangimport.cpp @@ -589,6 +589,9 @@ private: clang = "`-CXXRecordDecl 0x34cc5f8 col:7 class Foo"; ASSERT_EQUALS("class Foo ;", parse(clang)); + + clang = "`-CXXRecordDecl 0x34cc5f8 col:7 class Foo"; + ASSERT_EQUALS("class Foo ;", parse(clang)); } void cxxRecordDecl2() {