File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ Author: Daniel Kroening, kroening@kroening.com
11
11
#include < fstream>
12
12
13
13
#include < util/suffix.h>
14
+ #include < util/prefix.h>
14
15
#include < util/config.h>
15
16
16
17
#include " java_bytecode_parser.h"
@@ -254,10 +255,21 @@ std::string java_class_loadert::file_to_class_name(const std::string &file)
254
255
{
255
256
std::string result=file;
256
257
257
- // strip .class
258
+ // Strip .class. Note that the Java class loader would
259
+ // not do that.
258
260
if (has_suffix (result, " .class" ))
259
261
result.resize (result.size ()-6 );
260
262
263
+ // Strip a "./" prefix. Note that the Java class loader
264
+ // would not do that.
265
+ #ifdef _WIN32
266
+ while (has_prefix (result, " .\\ " ))
267
+ result=std::string (result, 2 , std::string::npos);
268
+ #else
269
+ while (has_prefix (result, " ./" ))
270
+ result=std::string (result, 2 , std::string::npos);
271
+ #endif
272
+
261
273
// slash to dot
262
274
for (std::string::iterator it=result.begin (); it!=result.end (); it++)
263
275
if (*it==' /' ) *it=' .' ;
You can’t perform that action at this time.
0 commit comments