diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-03-28 00:36:55 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-03-28 00:36:55 -0500 |
commit | c98929e95404b341d033d4db795b5fa7017ab9be (patch) | |
tree | ee3b344c1d7e5277bfbd9210ae56cca60dc1eb95 /tdelfeditor | |
parent | f5b2a9a7b203e89c1553ffa9a8371bac32f21aa3 (diff) | |
download | tdelibs-c98929e95404b341d033d4db795b5fa7017ab9be.tar.gz tdelibs-c98929e95404b341d033d4db795b5fa7017ab9be.zip |
Fix tdelfeditor choking on metadata parameters that start with a dash
Diffstat (limited to 'tdelfeditor')
-rw-r--r-- | tdelfeditor/tdelfeditor.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tdelfeditor/tdelfeditor.cpp b/tdelfeditor/tdelfeditor.cpp index fc17f03da..8f4317cc3 100644 --- a/tdelfeditor/tdelfeditor.cpp +++ b/tdelfeditor/tdelfeditor.cpp @@ -187,7 +187,7 @@ int handle_arguments(int argc, char **argv, eMode *mode) opterr = 0; /* Prevent automatic getopt() error message */ - while ((c = getopt_long(argc, argv, elficon_options.short_options, elficon_options.long_options, &index)) != EOF) + while ((c = getopt_long((argc>3)?3:argc, argv, elficon_options.short_options, elficon_options.long_options, &index)) != EOF) { switch(c) { @@ -234,8 +234,10 @@ int handle_arguments(int argc, char **argv, eMode *mode) goto print_icon_usage; } index++; - if(argc != required_params) + if(argc != required_params) { + fprintf(stderr, _("%s: was given %d arguments, needed %d\n"), argv[PARAM_PROGNAME], argc, required_params); goto print_icon_usage; + } } return TRUE; print_icon_usage: |