equal
deleted
inserted
replaced
186 /* the usual suspects */ |
186 /* the usual suspects */ |
187 char clientPattern[] = "lib/client"; |
187 char clientPattern[] = "lib/client"; |
188 char serverPattern[] = "lib/server"; |
188 char serverPattern[] = "lib/server"; |
189 char *envpath; |
189 char *envpath; |
190 char *path; |
190 char *path; |
|
191 char* save_ptr = NULL; |
191 jboolean clientPatternFound; |
192 jboolean clientPatternFound; |
192 jboolean serverPatternFound; |
193 jboolean serverPatternFound; |
193 |
194 |
194 /* fastest path */ |
195 /* fastest path */ |
195 if (env == NULL) { |
196 if (env == NULL) { |
205 |
206 |
206 /* |
207 /* |
207 * we have a suspicious path component, check if it contains a libjvm.so |
208 * we have a suspicious path component, check if it contains a libjvm.so |
208 */ |
209 */ |
209 envpath = JLI_StringDup(env); |
210 envpath = JLI_StringDup(env); |
210 for (path = JLI_StrTok(envpath, ":"); path != NULL; path = JLI_StrTok(NULL, ":")) { |
211 for (path = strtok_r(envpath, ":", &save_ptr); path != NULL; path = strtok_r(NULL, ":", &save_ptr)) { |
211 if (clientPatternFound && JLI_StrStr(path, clientPattern) != NULL) { |
212 if (clientPatternFound && JLI_StrStr(path, clientPattern) != NULL) { |
212 if (JvmExists(path)) { |
213 if (JvmExists(path)) { |
213 JLI_MemFree(envpath); |
214 JLI_MemFree(envpath); |
214 return JNI_TRUE; |
215 return JNI_TRUE; |
215 } |
216 } |