History

fftools/cmdutils: do not treat single '-' as an option in locate_option()

Fixes early parsing of trailing -v/-loglevel while using '-' to output to stdout.

Anton Khirnov committed 2 years ago

Commit 840b95b1 parent e56d6761 file · +2 −1Browse files

Unified · Split

fftools/cmdutils.c+2−1
@@ -492,8 +492,9 @@ int locate_option(int argc, char **argv, const OptionDef *options, · 491 unmodified lines
492 for (i = 1; i < argc; i++) {492 for (i = 1; i < argc; i++) {
493 const char *cur_opt = argv[i];493 const char *cur_opt = argv[i];
494 494
495 if (*cur_opt++ != '-')495 if (!(cur_opt[0] == '-' && cur_opt[1]))
496 continue;496 continue;
497 cur_opt++;
497 498
498 po = find_option(options, cur_opt);499 po = find_option(options, cur_opt);
499 if (!po->name && cur_opt[0] == 'n' && cur_opt[1] == 'o')500 if (!po->name && cur_opt[0] == 'n' && cur_opt[1] == 'o')

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t