From 8ed4a312b78eb0c243267978b776a443ddb55a83 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Thu, 10 May 2012 10:16:22 +0100 Subject: mingw32: fix off-by-one errors in spawn routines There are two changes here. The first, in mingw_spawn_1, removes a post-increment of argv which should have no effect. The second, in mingw_spawn, should fix a reported problem with xargs: https://github.com/pclouds/busybox-w32/issues/19 Basically, 'find . -type f | xargs md5sum' was failing to process the first file. --- win32/process.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win32/process.c b/win32/process.c index 0db1a455a..53ad44a42 100644 --- a/win32/process.c +++ b/win32/process.c @@ -261,7 +261,7 @@ mingw_spawn_1(int mode, const char *cmd, const char *const *argv, const char *co if (ENABLE_FEATURE_PREFER_APPLETS && find_applet_by_name(cmd) >= 0) - return mingw_spawn_applet(mode, cmd, argv++, envp); + return mingw_spawn_applet(mode, cmd, argv, envp); else if (is_absolute_path(cmd)) return mingw_spawn_interpreter(mode, cmd, argv, envp); else { @@ -290,7 +290,7 @@ mingw_spawn_1(int mode, const char *cmd, const char *const *argv, const char *co pid_t mingw_spawn(char **argv) { - return mingw_spawn_1(P_NOWAIT, argv[0], (const char *const *)(argv+1), (const char *const *)environ); + return mingw_spawn_1(P_NOWAIT, argv[0], (const char *const *)argv, (const char *const *)environ); } int -- cgit v1.2.3-55-g6feb