Skip to content

Commit

Permalink
Update allsky_common.cpp: Ignore empty --cmd argument
Browse files Browse the repository at this point in the history
ZWO cameras don't use "-cmd command" so pass "" for the command.  Ignore that so checks for "if (cmdToUse == NULL)" work.
  • Loading branch information
EricClaeys authored Nov 20, 2024
1 parent 662b235 commit ddf1442
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/allsky_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ddf1442

Please sign in to comment.