Skip to content

Commit 6fe978d

Browse files
author
Daniel Kroening
committed
file_to_class_name needs to convert backslashes
1 parent 080ff6d commit 6fe978d

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
@@ -294,10 +294,14 @@ std::string java_class_loadert::file_to_class_name(const std::string &file)
294294
result=std::string(result, 2, std::string::npos);
295295
#endif
296296

297-
// slash to dot
298-
for(std::string::iterator it=result.begin(); it!=result.end(); it++)
299-
if(*it=='/')
300-
*it='.';
297+
// slash (and backslash) to dot
298+
for(auto &ch : result)
299+
#ifdef _WIN32
300+
if(ch == '/' || ch == '\\')
301+
#else
302+
if(ch == '/')
303+
#endif
304+
ch = '.';
301305

302306
return result;
303307
}

0 commit comments

Comments
 (0)