From ddf14425d65b2726e02ea9c073b57ee21c81b241 Mon Sep 17 00:00:00 2001 From: Eric Claeys <83164203+EricClaeys@users.noreply.github.com> Date: Wed, 20 Nov 2024 03:39:33 -0600 Subject: [PATCH] Update allsky_common.cpp: Ignore empty --cmd argument ZWO cameras don't use "-cmd command" so pass "" for the command. Ignore that so checks for "if (cmdToUse == NULL)" work. --- src/allsky_common.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/allsky_common.cpp b/src/allsky_common.cpp index d99716f82..a252560f6 100644 --- a/src/allsky_common.cpp +++ b/src/allsky_common.cpp @@ -1594,13 +1594,20 @@ bool getCommandLineArguments(config *cg, int argc, char *argv[], bool readConfig else if (strcmp(a, "cmd") == 0) { cg->cmdToUse = argv[++i]; - if (strcmp(cg->cmdToUse, "raspistill") == 0) + if (cg->cmdToUse[0] == '\0') { - cg->isLibcamera = false; + cg->cmdToUse = NULL; // usually with ZWO, which doesn't use this } else { - cg->isLibcamera = true; + if (strcmp(cg->cmdToUse, "raspistill") == 0) + { + cg->isLibcamera = false; + } + else + { + cg->isLibcamera = true; + } } } else if (strcmp(a, "tty") == 0) // overrides what was automatically determined