Changeset 32880 for main/trunk/search4j/libsearch4j.cpp
- Timestamp:
- 2019-03-08T09:46:01+13:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/search4j/libsearch4j.cpp
r30172 r32880 245 245 bool found = false; 246 246 while (caret < max_search_length && !found) { 247 if ( strcmp( output.substr( caret, 12 ).c_str() , "java version" ) == 0 ) { 248 era_ = atoi( output.substr(caret + 14,1).c_str() ); 249 major_ = atoi( output.substr(caret + 16,1).c_str() ); 250 minor_ = atoi( output.substr(caret + 18,1).c_str() ); 251 update_ = atoi( output.substr(caret + 20,2).c_str() ); 247 const int to_match_len = 8; 248 if ( strcmp( output.substr( caret, to_match_len ).c_str() , " version" ) == 0 ) { 249 era_ = atoi( output.substr(caret + to_match_len + 2,1).c_str() ); 250 major_ = atoi( output.substr(caret + to_match_len + 4,1).c_str() ); 251 minor_ = atoi( output.substr(caret + to_match_len + 6,1).c_str() ); 252 update_ = atoi( output.substr(caret + to_match_len + 8,2).c_str() ); 252 253 found = true; 253 254 } … … 318 319 if ( verbose ) cout << "Searching for a JVM" << endl; 319 320 320 char *javaHomeEnv = "";321 char *javaHomeEnv = NULL; 321 322 bool jvmFound = false; 322 323
Note:
See TracChangeset
for help on using the changeset viewer.