You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2016/01/26 12:59:32 UTC
lucy-charmonizer git commit: Swap checks for "nul" and "/dev/null"
Repository: lucy-charmonizer
Updated Branches:
refs/heads/master bdc7a9882 -> 38166d425
Swap checks for "nul" and "/dev/null"
Some CPAN Testers Windows boxes seem to have a "/dev/null". Also print
the detected OS.
Project: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/commit/38166d42
Tree: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/tree/38166d42
Diff: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/diff/38166d42
Branch: refs/heads/master
Commit: 38166d42564251e566253bbfedbc6dd741216ad4
Parents: bdc7a98
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Tue Jan 26 12:56:52 2016 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Jan 26 12:56:52 2016 +0100
----------------------------------------------------------------------
src/Charmonizer/Core/OperatingSystem.c | 30 +++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/38166d42/src/Charmonizer/Core/OperatingSystem.c
----------------------------------------------------------------------
diff --git a/src/Charmonizer/Core/OperatingSystem.c b/src/Charmonizer/Core/OperatingSystem.c
index 057a0ab..513ce44 100644
--- a/src/Charmonizer/Core/OperatingSystem.c
+++ b/src/Charmonizer/Core/OperatingSystem.c
@@ -50,8 +50,20 @@ chaz_OS_init(void) {
printf("Trying to find a bit-bucket a la /dev/null...\n");
}
- /* Detect shell based on whether the bitbucket is "/dev/null" or "nul". */
- if (chaz_Util_can_open_file("/dev/null")) {
+ /* Detect shell based on whether the bitbucket is "/dev/null" or "nul".
+ * Start with "nul" as some Windows boxes seem to have a "/dev/null".
+ */
+ if (chaz_Util_can_open_file("nul")) {
+ strcpy(chaz_OS.name, "windows");
+ strcpy(chaz_OS.dev_null, "nul");
+ strcpy(chaz_OS.dir_sep, "\\");
+ strcpy(chaz_OS.exe_ext, ".exe");
+ strcpy(chaz_OS.shared_lib_ext, ".dll");
+ strcpy(chaz_OS.static_lib_ext, ".lib");
+ strcpy(chaz_OS.local_command_start, ".\\");
+ chaz_OS.shell_type = CHAZ_OS_CMD_EXE;
+ }
+ else if (chaz_Util_can_open_file("/dev/null")) {
char *uname;
size_t uname_len;
size_t i;
@@ -84,20 +96,14 @@ chaz_OS_init(void) {
}
strcpy(chaz_OS.local_command_start, "./");
}
- else if (chaz_Util_can_open_file("nul")) {
- strcpy(chaz_OS.name, "windows");
- strcpy(chaz_OS.dev_null, "nul");
- strcpy(chaz_OS.dir_sep, "\\");
- strcpy(chaz_OS.exe_ext, ".exe");
- strcpy(chaz_OS.shared_lib_ext, ".dll");
- strcpy(chaz_OS.static_lib_ext, ".lib");
- strcpy(chaz_OS.local_command_start, ".\\");
- chaz_OS.shell_type = CHAZ_OS_CMD_EXE;
- }
else {
/* Bail out because we couldn't find anything like /dev/null. */
chaz_Util_die("Couldn't find anything like /dev/null");
}
+
+ if (chaz_Util_verbosity) {
+ printf("Detected OS: %s\n", chaz_OS.name);
+ }
}
const char*