From: Frederic Marchal Date: Thu, 25 Jul 2013 05:32:46 +0000 (+0200) Subject: Process correctly run together options X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=da186036d5ea1c90b30cb2c5e7ed1e09c210e0f1;p=thirdparty%2Fsarg.git Process correctly run together options If sarg is ran with option -l combined with any other option such as -xl, then the -l option is mistaken as --lastlog and does not produce the expected result (which is to use the access.log file passed as argument). It has been fixed by requiring that any long option is préfixed with a double dash. It breaks the compatibility with old versions but nobody should notice. Thanks to Leonardo Rodrigues for reporting this bug. --- diff --git a/log.c b/log.c index e70ff82..d19426a 100644 --- a/log.c +++ b/log.c @@ -278,7 +278,7 @@ int main(int argc,char *argv[]) strcpy(Title,_("Squid User Access Report")); - while((ch = getopt_long_only(argc, argv, "a:b:c:d:e:f:g:hikl:L:mno:P:prs:t:u:vw:xyz",long_options,&option_index)) != -1){ + while((ch = getopt_long(argc, argv, "a:b:c:d:e:f:g:hikl:L:mno:P:prs:t:u:vw:xyz",long_options,&option_index)) != -1){ switch(ch) { case 0: