Repository: lucy-charmonizer Updated Branches: refs/heads/master 0e2ea3b81 -> 698cd055f
Fix null device when running sh.exe through cmd.exe Use "nul" as null device since output is redirected by cmd.exe. Project: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/commit/698cd055 Tree: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/tree/698cd055 Diff: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/diff/698cd055 Branch: refs/heads/master Commit: 698cd055ff7e6bb592b0da7f8ffdeb0d1e87a142 Parents: 0e2ea3b Author: Nick Wellnhofer <[email protected]> Authored: Mon Jul 4 20:25:33 2016 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Mon Jul 4 20:25:33 2016 +0200 ---------------------------------------------------------------------- src/Charmonizer/Core/OperatingSystem.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/698cd055/src/Charmonizer/Core/OperatingSystem.c ---------------------------------------------------------------------- diff --git a/src/Charmonizer/Core/OperatingSystem.c b/src/Charmonizer/Core/OperatingSystem.c index 6fc7484..446872b 100644 --- a/src/Charmonizer/Core/OperatingSystem.c +++ b/src/Charmonizer/Core/OperatingSystem.c @@ -83,6 +83,9 @@ chaz_OS_init(void) { chaz_OS.shell_type = CHAZ_OS_CMD_EXE; chaz_OS.run_sh_via_cmd_exe = 0; } + + /* Redirection is always run through cmd.exe. */ + strcpy(chaz_OS.dev_null, "nul"); } else if (output_len >= 7 && memcmp(output, "foo^bar", 7) == 0) { /* Escape character is backslash. */ @@ -90,17 +93,16 @@ chaz_OS_init(void) { printf("Detected POSIX shell\n"); } chaz_OS.shell_type = CHAZ_OS_POSIX; + strcpy(chaz_OS.dev_null, "/dev/null"); } if (chaz_OS.shell_type == CHAZ_OS_CMD_EXE) { strcpy(chaz_OS.dir_sep, "\\"); - strcpy(chaz_OS.dev_null, "nul"); /* Empty string should work, too. */ strcpy(chaz_OS.local_command_start, ".\\"); } else if (chaz_OS.shell_type == CHAZ_OS_POSIX) { strcpy(chaz_OS.dir_sep, "/"); - strcpy(chaz_OS.dev_null, "/dev/null"); strcpy(chaz_OS.local_command_start, "./"); } else {
