From af31dade367e72e04cefe8a43b80edd16155337b Mon Sep 17 00:00:00 2001 From: Simon Schubert <2@0x2c.org> Date: Fri, 17 Feb 2012 21:52:30 +0100 Subject: [PATCH] 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. --- dma.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.47.3