Skip to content

Commit 56aa050

Browse files
author
Daniel Kroening
committed
file_to_class_name needs to convert backslashes
1 parent d7d2b17 commit 56aa050

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

jbmc/src/java_bytecode/java_class_loader.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,14 @@ std::string java_class_loadert::file_to_class_name(const std::string &file)
312312
result=std::string(result, 2, std::string::npos);
313313
#endif
314314

315-
// slash to dot
316-
for(std::string::iterator it=result.begin(); it!=result.end(); it++)
317-
if(*it=='/')
318-
*it='.';
315+
// slash (and backslash) to dot
316+
for(auto &ch : result)
317+
#ifdef _WIN32
318+
if(ch == '/' || ch == '\\')
319+
#else
320+
if(ch == '/')
321+
#endif
322+
ch = '.';
319323

320324
return result;
321325
}

0 commit comments

Comments
 (0)