script: make optional argument more robust

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2019-04-03 16:36:43 +02:00
parent 596f42027d
commit 4f7521d66c
1 changed files with 2 additions and 0 deletions

View File

@ -934,6 +934,8 @@ int main(int argc, char **argv)
ctl.quiet = 1;
break;
case 't':
if (optarg && *optarg == '=')
optarg++;
log_associate(&ctl, &ctl.out,
optarg ? optarg : "/dev/stderr",
SCRIPT_FMT_TIMING_SIMPLE);