]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Replace tabs by spaces in the URL and the code
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Thu, 28 Jul 2011 13:07:03 +0000 (13:07 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Thu, 28 Jul 2011 13:07:03 +0000 (13:07 +0000)
Any tab encountered in a field of the input log file will send sarg off track
as it uses a tab to delimit columns in its temporary files.

To prevent this problem, the URL and the HTML code found in the input log file
are processed to replace any tab character by a single space.

log.c

diff --git a/log.c b/log.c
index bfa26c60064cbbe6bd65d4c8334d06f8f02eface..8b353da5a3197a07550d43708a4085dbbbfb5d24 100644 (file)
--- a/log.c
+++ b/log.c
@@ -1322,6 +1322,11 @@ int main(int argc,char *argv[])
                                for (x=3 ; str[x] ; x++) str[x-2]=str[x];
                        }
 #endif
+                       // replace any tab by a single space
+                       for (str=full_url ; *str ; str++)
+                               if (*str=='\t') *str=' ';
+                       for (str=code ; *str ; str++)
+                               if (*str=='\t') *str=' ';
 
                        urly=full_url;