From: Simon Schubert <2@0x2c.org> Date: Fri, 17 Feb 2012 20:52:30 +0000 (+0100) Subject: don't treat -options following -q as argument to it X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af31dade367e72e04cefe8a43b80edd16155337b;p=people%2Fms%2Fdma.git don't treat -options following -q as argument to it sendmail's -q takes an optional argument, but the way we use getopt(3) does not support this. Work around this by backtracking if the argument to -q starts with a dash, indicating that it is an option instead. --- diff --git a/dma.c b/dma.c index 48c429c..02fb846 100644 --- a/dma.c +++ b/dma.c @@ -476,6 +476,9 @@ main(int argc, char **argv) break; case 'q': + /* Don't let getopt slup up other arguments */ + if (optarg && *optarg == '-') + optind--; doqueue = 1; break;