Fix rm commands for cmd.exe

mingw32-make needs `%%` instead of `%`. This works with nmake as well.


Project: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/commit/9cf02f2a
Tree: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/tree/9cf02f2a
Diff: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/diff/9cf02f2a

Branch: refs/heads/master
Commit: 9cf02f2a283c1457a7df7bdf2cec805358e6911b
Parents: 746deba
Author: Nick Wellnhofer <[email protected]>
Authored: Sat May 21 18:15:21 2016 +0200
Committer: Nick Wellnhofer <[email protected]>
Committed: Sat May 21 18:15:21 2016 +0200

----------------------------------------------------------------------
 src/Charmonizer/Core/Make.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/9cf02f2a/src/Charmonizer/Core/Make.c
----------------------------------------------------------------------
diff --git a/src/Charmonizer/Core/Make.c b/src/Charmonizer/Core/Make.c
index 898ed49..df2a217 100644
--- a/src/Charmonizer/Core/Make.c
+++ b/src/Charmonizer/Core/Make.c
@@ -717,8 +717,8 @@ chaz_MakeRule_add_rm_command(chaz_MakeRule *rule, const 
char *files) {
         command = chaz_Util_join(" ", "rm -f", files, NULL);
     }
     else if (chaz_Make.shell_type == CHAZ_OS_CMD_EXE) {
-        command = chaz_Util_join("", "for %i in (", files,
-                                 ") do @if exist %i del /f %i", NULL);
+        command = chaz_Util_join("", "for %%i in (", files,
+                                 ") do @if exist %%i del /f %%i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", chaz_Make.shell_type);
@@ -736,8 +736,8 @@ chaz_MakeRule_add_recursive_rm_command(chaz_MakeRule *rule, 
const char *dirs) {
         command = chaz_Util_join(" ", "rm -rf", dirs, NULL);
     }
     else if (chaz_Make.shell_type == CHAZ_OS_CMD_EXE) {
-        command = chaz_Util_join("", "for %i in (", dirs,
-                                 ") do @if exist %i rmdir /s /q %i", NULL);
+        command = chaz_Util_join("", "for %%i in (", dirs,
+                                 ") do @if exist %%i rmdir /s /q %%i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", chaz_Make.shell_type);

Reply via email to