diff options
author | 2012-06-12 21:26:20 +0000 | |
---|---|---|
committer | 2012-06-12 21:26:20 +0000 | |
commit | fee648fe64a9ae531d5ff7cdef1b0ab96346b7fd (patch) | |
tree | 7df5cd38827eca590f799b18ec0498591892677b /mail-mta/nullmailer/files | |
parent | Don't use AM_PROG_AR in configure.ac as automake-1.11 does not recognize it (diff) | |
download | gentoo-2-fee648fe64a9ae531d5ff7cdef1b0ab96346b7fd.tar.gz gentoo-2-fee648fe64a9ae531d5ff7cdef1b0ab96346b7fd.tar.bz2 gentoo-2-fee648fe64a9ae531d5ff7cdef1b0ab96346b7fd.zip |
Fix option parsing - bug #420301
(Portage version: 2.1.10.65/cvs/Linux x86_64)
Diffstat (limited to 'mail-mta/nullmailer/files')
-rw-r--r-- | mail-mta/nullmailer/files/nullmailer-1.10-fix-sendmail.patch | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/mail-mta/nullmailer/files/nullmailer-1.10-fix-sendmail.patch b/mail-mta/nullmailer/files/nullmailer-1.10-fix-sendmail.patch new file mode 100644 index 000000000000..98669a64c777 --- /dev/null +++ b/mail-mta/nullmailer/files/nullmailer-1.10-fix-sendmail.patch @@ -0,0 +1,100 @@ +diff --git a/lib/cli++/main.cc b/lib/cli++/main.cc +index f0eb014..406e990 100644 +--- a/lib/cli++/main.cc ++++ b/lib/cli++/main.cc +@@ -36,6 +36,7 @@ static cli_option help_option = { 'h', "help", cli_option::flag, + + static cli_option** options; + static unsigned optionc; ++static const char* short_options; + + static void build_options() + { +@@ -47,6 +48,13 @@ static void build_options() + for(unsigned i = 0; i < optionc-1; i++) + options[i] = &cli_options[i]; + options[optionc-1] = &help_option; ++ ++ char* so; ++ short_options = so = new char[optionc+1]; ++ for (unsigned i = 0; i < optionc; i++) ++ if (options[i]->ch != 0) ++ *so++ = options[i]->ch; ++ *so = 0; + } + + static inline int max(int a, int b) +@@ -275,14 +283,6 @@ static int parse_long(int, char* argv[]) + ++arg; + for(unsigned j = 0; j < optionc; j++) { + cli_option* o = options[j]; +- if (cli_only_long && o->ch) { +- if (arg[0] == o->ch) { +- if (arg[1] == '\0') +- return o->parse_long_noeq(argv[1], true); +- else if (arg[1] == '=') +- return o->parse_long_eq(arg+2, true); +- } +- } + if(o->name) { + size_t len = strlen(o->name); + if(!memcmp(arg, o->name, len)) { +@@ -297,6 +297,13 @@ static int parse_long(int, char* argv[]) + return -1; + } + ++static int parse_either(int argc, char* argv[]) ++{ ++ return (strchr(short_options, argv[0][1]) != 0) ++ ? parse_short(argc, argv) ++ : parse_long(argc, argv); ++} ++ + static int parse_args(int argc, char* argv[]) + { + build_options(); +@@ -312,9 +319,9 @@ static int parse_args(int argc, char* argv[]) + i++; + break; + } +- int j = (!cli_only_long && arg[1] != '-') +- ? parse_short(argc-i, argv+i) +- : parse_long(argc-i, argv+i); ++ int j = (arg[1] == '-') ? parse_long(argc-i, argv+i) ++ : cli_only_long ? parse_either(argc-i, argv+i) ++ : parse_short(argc-i, argv+i); + if(j < 0) + usage(1); + else +diff --git a/src/sendmail.cc b/src/sendmail.cc +index f245226..2e5615b 100644 +--- a/src/sendmail.cc ++++ b/src/sendmail.cc +@@ -66,26 +66,13 @@ cli_option cli_options[] = { + { 'N', 0, cli_option::string, 0, &o_dummys, "Ignored", 0 }, + { 'n', 0, cli_option::flag, 0, &o_dummyi, "Ignored", 0 }, + { 'O', 0, cli_option::string, 0, &o_dummys, "Ignored", 0 }, +- { 0, "odb", cli_option::flag, 0, &o_dummyi, +- "Deliver in background (always true)", 0 }, +- { 0, "odf", cli_option::flag, 0, &o_dummyi, +- "Deliver in foreground (ignored)", 0 }, +- { 0, "oem", cli_option::flag, 0, &o_dummyi, +- "Ignored", 0 }, ++ { 'o', 0, cli_option::string, 0, &o_dummys, "Set sendmail flag, ignored", 0 }, + { 0, "em", cli_option::flag, 0, &o_dummyi, + "Ignored", 0 }, +- { 0, "oep", cli_option::flag, 0, &o_dummyi, +- "Ignored", 0 }, + { 0, "ep", cli_option::flag, 0, &o_dummyi, + "Ignored", 0 }, +- { 0, "oeq", cli_option::flag, 0, &o_dummyi, +- "Ignored", 0 }, + { 0, "eq", cli_option::flag, 0, &o_dummyi, + "Ignored", 0 }, +- { 0, "oi", cli_option::flag, 0, &o_dummyi, +- "Ignored", 0 }, +- { 0, "om", cli_option::flag, 0, &o_dummyi, +- "Ignored", 0 }, + { 'p', 0, cli_option::string, 0, &o_dummys, "Ignored", 0 }, + { 'q', 0, cli_option::string, 0, &o_dummys, "Ignored", 0 }, + { 'R', 0, cli_option::string, 0, &o_dummys, "Ignored", 0 }, |