diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/mingw.c | 8 | ||||
-rw-r--r-- | win32/process.c | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index faa9f2b57..d9bb6e973 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -1803,3 +1803,11 @@ void *get_proc_addr(const char *dll, const char *function, | |||
1803 | errno = ENOSYS; | 1803 | errno = ENOSYS; |
1804 | return proc->pfunction; | 1804 | return proc->pfunction; |
1805 | } | 1805 | } |
1806 | |||
1807 | /* Return true if file is referenced using a path. This means a path | ||
1808 | * look-up isn't required. */ | ||
1809 | int has_path(const char *file) | ||
1810 | { | ||
1811 | return strchr(file, '/') || strchr(file, '\\') || | ||
1812 | has_dos_drive_prefix(file); | ||
1813 | } | ||
diff --git a/win32/process.c b/win32/process.c index ac63a9c58..1118eb18a 100644 --- a/win32/process.c +++ b/win32/process.c | |||
@@ -348,7 +348,7 @@ mingw_spawn_1(int mode, const char *cmd, char *const *argv, char *const *envp) | |||
348 | return mingw_spawn_applet(mode, argv, envp); | 348 | return mingw_spawn_applet(mode, argv, envp); |
349 | else | 349 | else |
350 | #endif | 350 | #endif |
351 | if (strchr(cmd, '/') || strchr(cmd, '\\') || has_dos_drive_prefix(cmd)) { | 351 | if (has_path(cmd)) { |
352 | const char *path = auto_win32_extension(cmd); | 352 | const char *path = auto_win32_extension(cmd); |
353 | return mingw_spawn_interpreter(mode, path ? path : cmd, argv, envp, 0); | 353 | return mingw_spawn_interpreter(mode, path ? path : cmd, argv, envp, 0); |
354 | } | 354 | } |