diff options
Diffstat (limited to 'python-wrapper.c')
-rw-r--r-- | python-wrapper.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/python-wrapper.c b/python-wrapper.c index ecc26bc..0a10bc9 100644 --- a/python-wrapper.c +++ b/python-wrapper.c @@ -50,8 +50,12 @@ const char* find_path(const char* exe) PATH = ":/bin:/usr/bin"; } char* path = strdup(PATH); +#ifdef HAVE_STRTOK_R char* state = NULL; const char* token = strtok_r(path, ":", &state); +#else + const char* token = strtok(path, ":"); +#endif while (token) { /* If an element of PATH is empty ("::"), then it is "." */ @@ -65,7 +69,11 @@ const char* find_path(const char* exe) { return token; } +#ifdef HAVE_STRTOK_R token = strtok_r(NULL, ":", &state); +#else + token = strtok(NULL, ":"); +#endif } return NULL; } |