forked from gavin/bc
1
0
Fork 0
Browse Source

Make -e and -f error after -f-

master
Gavin Howard 2 years ago
parent
commit
9030a8fff4
Signed by untrusted user who does not match committer: gavin
GPG Key ID: C08038BDF280D33E
  1. 8
      src/args.c

8
src/args.c

@ -108,6 +108,8 @@ void bc_args(int argc, char *argv[]) {
case 'e':
{
if (vm.no_exit_exprs)
bc_vm_verr(BC_ERROR_FATAL_OPTION, "-e (--expression)");
bc_args_exprs(opts.optarg);
break;
}
@ -115,7 +117,11 @@ void bc_args(int argc, char *argv[]) {
case 'f':
{
if (!strcmp(opts.optarg, "-")) vm.no_exit_exprs = true;
else bc_args_file(opts.optarg);
else {
if (vm.no_exit_exprs)
bc_vm_verr(BC_ERROR_FATAL_OPTION, "-f (--file)");
bc_args_file(opts.optarg);
}
break;
}

Loading…
Cancel
Save