]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Process correctly run together options
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 25 Jul 2013 05:32:46 +0000 (07:32 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 25 Jul 2013 05:32:46 +0000 (07:32 +0200)
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.

log.c

diff --git a/log.c b/log.c
index e70ff82f475c3e9ca3a57563b9bf8cedae024f0c..d19426ae1c8aee9b532f8e9b2f9f1bbe5e2933d6 100644 (file)
--- 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: