]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Complex file names out of messages to translate
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Fri, 26 Dec 2014 14:10:42 +0000 (15:10 +0100)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Fri, 26 Dec 2014 14:10:42 +0000 (15:10 +0100)
Including the file name in the translatable string creates too many
messages to translate. They just differ by the file name.

22 files changed:
auth.c
datafile.c
download.c
email.c
grepday.c
html.c
include/defs.h
lastlog.c
log.c
realtime.c
redirector.c
repday.c
report.c
siteuser.c
smartfilter.c
sort.c
splitlog.c
topsites.c
topuser.c
totday.c
useragent.c
util.c

diff --git a/auth.c b/auth.c
index 5bd23dad075458a49b457641b845f2f6f33a2040..b87d7b20e22dd6aa51ccc6eb84868e74584b63bc 100644 (file)
--- a/auth.c
+++ b/auth.c
@@ -39,7 +39,8 @@ void htaccess(const struct userinfostruct *uinfo)
                return;
 
        if (snprintf(htname,sizeof(htname),"%s/%s/.htaccess",outdirname,uinfo->filename)>=sizeof(htname)) {
-               debuga(_("File name too long: %s/%s/.htaccess\n"),outdirname,uinfo->filename);
+               debuga(_("Path too long: "));
+               debuga_more("%s/%s/.htaccess\n",outdirname,uinfo->filename);
                exit(EXIT_FAILURE);
        }
        if((fp_auth=fopen(htname,"w"))==NULL) {
index 5a70eddda89a7bf2a3f6f3fb7333a26a29a9b09f..2cc6e4cbc2ed7610f1a4165ab4b36862ff81617c 100644 (file)
@@ -84,7 +84,8 @@ void data_file(char *tmp)
 
                sort_users_log(tmp,debug,uinfo);
                if (snprintf(tmp3,sizeof(tmp3),"%s/%s.user_log",tmp,uinfo->filename)>=sizeof(tmp3)) {
-                       debugapos("datafile",_("Directory path too long: %s/%s.user_log\n"),tmp,uinfo->filename);
+                       debugapos("datafile",_("Path too long: "));
+                       debuga_more("%s/%s.user_log\n",tmp,uinfo->filename);
                        exit(EXIT_FAILURE);
                }
 
index 4ed1f44a9eeae46c23b0e28cd9ffeb60bf59b7d0..231ae285403bfaf991886dc7e3769000f0097dc6 100644 (file)
@@ -62,7 +62,9 @@ static void download_sort(const char *report_in)
        clen=snprintf(csort,sizeof(csort),"sort -T \"%s\" -t \"\t\" -k 3,3 -k 1,1 -k 2,2 -k 5,5 -o \"%s\" \"%s/download.int_unsort\"",
                        tmp, report_in, tmp);
        if (clen>=sizeof(csort)) {
-               debuga(_("Path too long to sort the file: %s/download.int_unsort\n"),tmp);
+               debuga(_("Command too long: "));
+               debuga_more("sort -T \"%s\" -t \"\t\" -k 3,3 -k 1,1 -k 2,2 -k 5,5 -o \"%s\" \"%s/download.int_unsort\"",
+                                       tmp, report_in, tmp);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
@@ -72,7 +74,8 @@ static void download_sort(const char *report_in)
                exit(EXIT_FAILURE);
        }
        if (snprintf(csort,sizeof(csort),"%s/download.int_unsort",tmp)>=sizeof(csort)) {
-               debuga(_("Path too long for %s/download.int_unsort\n"),tmp);
+               debuga(_("Path too long: "));
+               debuga_more("%s/download.int_unsort\n",tmp);
                exit(EXIT_FAILURE);
        }
        if (!KeepTempLog && unlink(csort)) {
diff --git a/email.c b/email.c
index 5472c12d64294b0f72d9f20516d0a2c20d07767c..6198d7bc705767d5abb034502065d02a5ce088ef 100644 (file)
--- a/email.c
+++ b/email.c
@@ -132,7 +132,8 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema
 #endif
 
        if (snprintf(csort,sizeof(csort),"sort -n -T \"%s\" -t \"\t\" -r -k 2,2 -o \"%s\" \"%s\"", TempDir, top1, top2)>=sizeof(csort)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),top2,top1);
+               debuga(_("Command too long: "));
+               debuga_more("sort -n -T \"%s\" -t \"\t\" -r -k 2,2 -o \"%s\" \"%s\"", TempDir, top1, top2);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
index efe63025f928a786c5344f1804ad80d38ae74af8..6a69979738aa1dc81a18fe4d6fb5202a85af3866 100644 (file)
--- a/grepday.c
+++ b/grepday.c
@@ -613,7 +613,9 @@ static void greport_plot(const struct userinfostruct *uinfo,struct PlotStruct *p
        }
 
        if (snprintf(graph,sizeof(graph),"%s/%s/%s",outdirname,uinfo->filename,pdata->pngfile)>=sizeof(graph)) {
-               debuga(_("user name too long for %s/%s/%s\n"),outdirname,uinfo->filename,pdata->pngfile);
+               /* TRANSLATORS: The message is followed by the path that is too long. */
+               debuga(_("User name too long to manufacture file name "));
+               debuga_more("%s/%s/%s\n",outdirname,uinfo->filename,pdata->pngfile);
                exit(EXIT_FAILURE);
        }
        if((pngout=fopen(graph,"wb"))==NULL) {
@@ -682,7 +684,8 @@ void greport_day(const struct userinfostruct *uinfo)
        struct PlotStruct pdata;
 
        if (snprintf(wdirname,sizeof(wdirname),"%s/%s.day",tmp,uinfo->filename)>=sizeof(wdirname)) {
-               debuga(_("user name too long for %s/%s.day\n"),tmp,uinfo->filename);
+               debuga(_("User name too long to manufacture file name "));
+               debuga_more("%s/%s.day\n",tmp,uinfo->filename);
                exit(EXIT_FAILURE);
        }
        if(access(wdirname, R_OK) != 0) {
@@ -736,7 +739,8 @@ void greport_day(const struct userinfostruct *uinfo)
        }
 
        if (snprintf(wdirname,sizeof(wdirname),"%s/%s/graph.html",outdirname,uinfo->filename)>=sizeof(wdirname)) {
-               debuga(_("user name too long for %s/%s/%s\n"),outdirname,uinfo->filename,"graph.html");
+               debuga(_("User name too long to manufacture file name "));
+               debuga_more("%s/%s/%s\n",outdirname,uinfo->filename,"graph.html");
                exit(EXIT_FAILURE);
        }
        if ((fp_ou=fopen(wdirname,"wt"))==NULL) {
diff --git a/html.c b/html.c
index 8abea3bdf486703dd3f57e2ea9e6ede7fbfc1a15..5eb858f25f2b2c6732ceeb4d7ee600a703667d68 100644 (file)
--- a/html.c
+++ b/html.c
@@ -61,12 +61,14 @@ void htmlrel(void)
        userscan uscan;
 
        if (snprintf(tmp2,sizeof(tmp2),"%s/sargtmp.int_unsort",tmp)>=sizeof(tmp2)) {
-               debuga(_("File name too long: %s/sargtmp.int_unsort\n"),tmp);
+               debuga(_("Path too long: "));
+               debuga_more("%s/sargtmp.int_unsort\n",tmp);
                exit(EXIT_FAILURE);
        }
 
        if (snprintf(tmp3,sizeof(tmp3),"%s/sargtmp.int_log",tmp)>=sizeof(tmp3)) {
-               debuga(_("File name too long: %s/sargtmp.int_log\n"),tmp);
+               debuga(_("Path too long: "));
+               debuga_more("%s/sargtmp.int_log\n",tmp);
                exit(EXIT_FAILURE);
        }
 
@@ -84,7 +86,8 @@ void htmlrel(void)
        }
        while ( (uinfo = userinfo_advancescan(uscan)) != NULL ) {
                if (snprintf(warea,sizeof(warea),"%s/%s",outdirname,uinfo->filename)>=sizeof(warea)) {
-                       debuga(_("Destination directory too long: %s/%s\n"),outdirname,uinfo->filename);
+                       debuga(_("Destination directory too long: "));
+                       debuga_more("%s/%s\n",outdirname,uinfo->filename);
                        exit(EXIT_FAILURE);
                }
                if (!uinfo->topuser) {
@@ -102,7 +105,8 @@ void htmlrel(void)
                tmpsort(uinfo);
 
                if (snprintf(arqin,sizeof(arqin),"%s/htmlrel.txt",tmp)>=sizeof(arqin)) {
-                       debuga(_("Input file name too long: %s/htmlrel.txt\n"),tmp);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s/htmlrel.txt\n",tmp);
                        exit(EXIT_FAILURE);
                }
                if ((fp_in = fopen(arqin, "r")) == 0){
@@ -112,11 +116,13 @@ void htmlrel(void)
                }
 
                if (snprintf(arqou,sizeof(arqou),"%s/%s/%s.html",outdirname,uinfo->filename,uinfo->filename)>=sizeof(arqou)) {
-                       debuga(_("Output file name too long: %s/%s/%s.html\n"),outdirname,uinfo->filename,uinfo->filename);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s/%s/%s.html\n",outdirname,uinfo->filename,uinfo->filename);
                        exit(EXIT_FAILURE);
                }
                if (snprintf(duser,sizeof(duser),"%s/denied_%s.html",outdirname,uinfo->filename)>=sizeof(duser)) {
-                       debuga(_("File name too long: %s/denied_%s.html\n"),outdirname,uinfo->filename);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s/denied_%s.html\n",outdirname,uinfo->filename);
                        exit(EXIT_FAILURE);
                }
                if(access(duser, R_OK) != 0)
@@ -332,7 +338,8 @@ void htmlrel(void)
 
                        if(iprel) {
                                if (snprintf(arqip,sizeof(arqip),"%s/%s.ip",tmp,uinfo->filename)>=sizeof(arqip)) {
-                                       debuga(_("File name too long: %s/%s.ip\n"),tmp,uinfo->filename);
+                                       debuga(_("Path too long: "));
+                                       debuga_more("%s/%s.ip\n",tmp,uinfo->filename);
                                        exit(EXIT_FAILURE);
                                }
 
@@ -385,7 +392,8 @@ void htmlrel(void)
                                fclose(fp_ip2);
 
                                if (snprintf(csort,sizeof(csort),"sort -n -t \"\t\" -T \"%s\" -k 1,1 -k 2,2 -o \"%s\" \"%s\"",tmp,tmp3,tmp2)>=sizeof(csort)) {
-                                       debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),tmp2,tmp3);
+                                       debuga(_("Command too long: "));
+                                       debuga_more("sort -n -t \"\t\" -T \"%s\" -k 1,1 -k 2,2 -o \"%s\" \"%s\"",tmp,tmp3,tmp2);
                                        exit(EXIT_FAILURE);
                                }
                                cstatus=system(csort);
index 3828cff4cae79514dde77e22d0668075b03b61cd..7bd43cbbfe0ff97b48a579121dad2e11c576f52a 100755 (executable)
@@ -274,6 +274,7 @@ void output_html_string(FILE *fp_ou,const char *str,int maxlen);
 void output_html_url(FILE *fp_ou,const char *url);
 void output_html_link(FILE *fp_ou,const char *url,int maxlen);
 void debuga(const char *msg,...) __attribute__((format(printf,1,2)));
+void debuga_more(const char *msg,...);
 void debugapos(const char *pos,const char *msg,...);
 void debugaz(const char *msg,...) __attribute__((format(printf,1,2)));
 void my_lltoa(unsigned long long int n, char *s, int ssize, int len);
index 7cf25096d54ef1a678505dd12627908ea76d92a2..e4736f55fae33508135bd094054d89439c084d40 100644 (file)
--- a/lastlog.c
+++ b/lastlog.c
@@ -47,7 +47,8 @@ void mklastlog(const char *outdir)
                return;
 
        if (snprintf(temp,sizeof(temp),"%s/lastlog1",tmp)>=sizeof(temp)) {
-               debuga(_("File name too long: %s/lastlog1\n"),tmp);
+               debuga(_("Path too long: "));
+               debuga_more("%s/lastlog1\n",tmp);
                exit(EXIT_FAILURE);
        }
        if((fp_ou=fopen(temp,"w"))==NULL) {
@@ -126,7 +127,8 @@ void mklastlog(const char *outdir)
                if(debug)
                        debuga(_("Removing old report file \"%s\"\n"),gwarea.current);
                if (snprintf(temp,sizeof(temp),"%s%s",outdir,gwarea.current)>=sizeof(temp)) {
-                       debuga(_("Directory name too long: %s%s\n"),outdir,gwarea.current);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s%s\n",outdir,gwarea.current);
                        exit(EXIT_FAILURE);
                }
                unlinkdir(temp,0);
diff --git a/log.c b/log.c
index 6d49ada206b608bf3b6967f9bcca9e842b0cc5e8..ce2f5c4ea74252391a24a7c543d9bd4ea0d911a1 100644 (file)
--- a/log.c
+++ b/log.c
@@ -903,7 +903,8 @@ int main(int argc,char *argv[])
                                        my_mkdir(ParsedOutputLog);
                                }
                                if (snprintf(arq_log,sizeof(arq_log),"%s/sarg_temp.log",ParsedOutputLog)>=sizeof(arq_log)) {
-                                       debuga(_("File name too long: %s/sarg_temp.log\n"),ParsedOutputLog);
+                                       debuga(_("Path too long: "));
+                                       debuga_more("%s/sarg_temp.log\n",ParsedOutputLog);
                                        exit(EXIT_FAILURE);
                                }
                                if((fp_log=MY_FOPEN(arq_log,"w"))==NULL) {
@@ -1498,7 +1499,8 @@ int main(int argc,char *argv[])
                                        }
                                }
                                if (snprintf (tmp3, sizeof(tmp3), "%s/%s.user_unsort", tmp, ufile->user->filename)>=sizeof(tmp3)) {
-                                       debuga(_("Temporary user file name too long: %s/%s.user_unsort\n"), tmp, ufile->user->filename);
+                                       debuga(_("Path too long: "));
+                                       debuga_more("%s/%s.user_unsort\n", tmp, ufile->user->filename);
                                        exit(EXIT_FAILURE);
                                }
                                if ((ufile->file = MY_FOPEN (tmp3, "a")) == NULL) {
@@ -1670,7 +1672,8 @@ int main(int argc,char *argv[])
                strftime(val2,sizeof(val2),"%d%m%Y",&period.start);
                strftime(val1,sizeof(val1),"%d%m%Y",&period.end);
                if (snprintf(val4,sizeof(val4),"%s/sarg-%s_%s-%s_%s.log",ParsedOutputLog,val2,start_hour,val1,end_hour)>=sizeof(val4)) {
-                       debuga(_("File name too long: %s/sarg-%s_%s-%s_%s.log\n"),ParsedOutputLog,val2,start_hour,val1,end_hour);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s/sarg-%s_%s-%s_%s.log\n",ParsedOutputLog,val2,start_hour,val1,end_hour);
                        exit(EXIT_FAILURE);
                }
                if (rename(arq_log,val4)) {
@@ -1684,10 +1687,9 @@ int main(int argc,char *argv[])
                                necessary around the command name, put them in the configuration file.
                                */
                                if (snprintf(val1,sizeof(val1),"%s \"%s\"",ParsedOutputLogCompress,arq_log)>=sizeof(val1)) {
-                                       /* TRANSLATORS: The first %s is the command name. The second is the file name
-                                        * to act upon.
-                                        */
-                                       debuga(_("Command too long: %s \"%s\"\n"),ParsedOutputLogCompress,arq_log);
+                                       /* TRANSLATORS: The message is followed by the command that's too long. */
+                                       debuga(_("Command too long: "));
+                                       debuga_more("%s \"%s\"\n",ParsedOutputLogCompress,arq_log);
                                        exit(EXIT_FAILURE);
                                }
                                cstatus=system(val1);
@@ -1704,7 +1706,8 @@ int main(int argc,char *argv[])
 
        if(DataFile[0] == '\0' && (ReportType & REPORT_TYPE_DENIED) != 0) {
                if (snprintf(csort,sizeof(csort),"sort -T \"%s\" -t \"\t\" -k 3,3 -k 5,5 -o \"%s\" \"%s\"",tmp,denied_sort,denied_unsort)>=sizeof(csort)) {
-                       debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),denied_unsort,denied_sort);
+                       debuga(_("Command too long: "));
+                       debuga_more("sort -T \"%s\" -t \"\t\" -k 3,3 -k 5,5 -o \"%s\" \"%s\"",tmp,denied_sort,denied_unsort);
                        exit(EXIT_FAILURE);
                }
                cstatus=system(csort);
index 06c252be36ce1a37c2003db95ecdbfee6acfb222..2018fe4395918dac91f9b0c9dcd8cb1737f453c9 100755 (executable)
@@ -96,7 +96,8 @@ static void getlog(void)
 
        if (fd2!=-1) close(fd2);//not safe at all but good enough for now.
        if (snprintf(cmd,sizeof(cmd),"sort -t \"\t\" -r -n -k 1,1 -o \"%s\" \"%s\"",template2,template1)>=sizeof(cmd)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),template1,template2);
+               debuga(_("Command too long: "));
+               debuga_more("sort -t \"\t\" -r -n -k 1,1 -o \"%s\" \"%s\"",template2,template1);
                exit(EXIT_FAILURE);
        }
        cstatus=system(cmd);
index 193af4403abe8f11f34fea21cfd10c89ae8ce4b5..620cccfb35035557b887387d12d647795b6ca03e 100644 (file)
@@ -389,7 +389,8 @@ void redirector_log(void)
        }
 
        if (snprintf(tmp6,sizeof(tmp6),"sort -t \"\t\" -k 1,1 -k 2,2 -k 4,4 \"%s\" -o \"%s\"",guard_in, redirector_sorted)>=sizeof(tmp6)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),guard_in,redirector_sorted);
+               debuga(_("Command too long: "));
+               debuga_more("sort -t \"\t\" -k 1,1 -k 2,2 -k 4,4 \"%s\" -o \"%s\"",guard_in, redirector_sorted);
                exit(EXIT_FAILURE);
        }
        cstatus=system(tmp6);
index 179a38f9cc5b30dd1322638df92c72dac4777419..17be7050ad68a0f32765f0d14ba5e564a27cf025 100644 (file)
--- a/repday.c
+++ b/repday.c
@@ -61,7 +61,8 @@ void report_day(const struct userinfostruct *uinfo)
        if(access(wdirname, R_OK) != 0) return;
 
        if (snprintf(arqout,sizeof(arqout),"%s/%s/d%s.html",outdirname,uinfo->filename,uinfo->filename)>=sizeof(arqout)) {
-               debuga(_("Output file name too long: %s/%s/d%s.html\n"),outdirname,uinfo->filename,uinfo->filename);
+               debuga(_("Path too long: "));
+               debuga_more("%s/%s/d%s.html\n",outdirname,uinfo->filename,uinfo->filename);
                exit(EXIT_FAILURE);
        }
 
index 17450e7fbf87ead9ebbcf89ddc06d7104b526402..75c55fb1627c7bcd4a6b5b250e6797bccfa77861 100644 (file)
--- a/report.c
+++ b/report.c
@@ -117,7 +117,8 @@ void gerarel(void)
        while ((uinfo = userinfo_advancescan(uscan)) != NULL ) {
                sort_users_log(tmp,debug,uinfo);
                if (snprintf(tmp3,sizeof(tmp3),"%s/%s.user_log",tmp,uinfo->filename)>=sizeof(tmp3)) {
-                       debugapos("report",_("Directory entry too long: %s/%s.user_log\n"),tmp,uinfo->filename);
+                       debugapos("report",_("Path too long: "));
+                       debuga_more("%s/%s.user_log\n",tmp,uinfo->filename);
                        exit(EXIT_FAILURE);
                }
                if((fp_in=MY_FOPEN(tmp3,"r"))==NULL){
@@ -419,7 +420,8 @@ static FILE *maketmp(const char *user, const char *dirname, int debug)
 
        if(debug) debuga(_("Making file %s/%s\n"),tmp,user);
        if (snprintf(wdirname,sizeof(wdirname),"%s/%s.utmp",tmp,user)>=sizeof(wdirname)) {
-               debuga(_("Temporary file name too long: %s/%s.utmp\n"),tmp,user);
+               debuga(_("Path too long: "));
+               debuga_more("%s/%s.utmp\n",tmp,user);
                exit(EXIT_FAILURE);
        }
 
@@ -460,7 +462,8 @@ static void gravaporuser(const struct userinfostruct *uinfo, const char *dirname
        if((ReportType & REPORT_TYPE_USERS_SITES) == 0) return;
 
        if (snprintf(wdirname,sizeof(wdirname),"%s/%s.ip",tmp,uinfo->filename)>=sizeof(wdirname)) {
-               debuga(_("Path too long %s/%s.ip\n"),tmp,uinfo->filename);
+               debuga(_("Path too long: "));
+               debuga_more("%s/%s.ip\n",tmp,uinfo->filename);
                exit(EXIT_FAILURE);
        }
 
@@ -744,7 +747,8 @@ static void grava_SmartFilter(const char *dirname, const char *user, const char
        char wdirname[MAXLEN];
 
        if (snprintf(wdirname,sizeof(wdirname),"%s/smartfilter.int_unsort",dirname)>=sizeof(wdirname)) {
-               debuga(_("File name too long: %s/smartfilter.int_unsort\n"),dirname);
+               debuga(_("Path too long: "));
+               debuga_more("%s/smartfilter.int_unsort\n",dirname);
                exit(EXIT_FAILURE);
        }
 
index 5da57774ed101462ffc40c56a9f851f9bb13deca..79c688a9634dfbe9be0b12727d9e19e655ce5d8f 100644 (file)
@@ -60,7 +60,8 @@ void siteuser(void)
        sprintf(report,"%s/siteuser.html",outdirname);
 
        if (snprintf(csort,sizeof(csort),"sort -t \"\t\" -k 4,4 -k 1,1 -o \"%s\" \"%s\"",general2,general)>=sizeof(csort)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),general,general2);
+               debuga(_("Command too long: "));
+               debuga_more("sort -t \"\t\" -k 4,4 -k 1,1 -o \"%s\" \"%s\"",general2,general);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
index 8695b148bb1eb3208bdde9ebb25dedf270a74cec..40867c9989c142eac26a73f920c0bd2d6fc510a1 100644 (file)
@@ -55,19 +55,23 @@ void smartfilter_report(void)
        ouser[0]='\0';
 
        if (snprintf(smart_in,sizeof(smart_in),"%s/smartfilter.int_unsort",tmp)>=sizeof(smart_in)) {
-               debuga(_("File name too long: %s/smartfilter.int_unsort\n"),tmp);
+               debuga(_("Path too long: "));
+               debuga_more("%s/smartfilter.int_unsort\n",tmp);
                exit(EXIT_FAILURE);
        }
        if (snprintf(sites,sizeof(sites),"%s/sarg-sites",outdirname)>=sizeof(sites)) {
-               debuga(_("File name too long: %s/sarg-sites\n"),outdirname);
+               debuga(_("Path too long: "));
+               debuga_more("%s/sarg-sites\n",outdirname);
                exit(EXIT_FAILURE);
        }
        if (snprintf(smart_ou,sizeof(smart_ou),"%s/smartfilter.int_log",tmp)>=sizeof(smart_ou)) {
-               debuga(_("File name too long: %s/smartfilter.int_log\n"),tmp);
+               debuga(_("Path too long: "));
+               debuga_more("%s/smartfilter.int_log\n",tmp);
                exit(EXIT_FAILURE);
        }
        if (snprintf(report,sizeof(report),"%s/smartfilter.html",outdirname)>=sizeof(report)) {
-               debuga(_("File name too long: %s/smartfilter.html\n"),outdirname);
+               debuga(_("Path too long: "));
+               debuga_more("%s/smartfilter.html\n",outdirname);
                exit(EXIT_FAILURE);
        }
 
diff --git a/sort.c b/sort.c
index 6b70ba9244dbfb2f6be12aaa0030bc9fe72e6a3d..d092fd2e090fac3d6772acd4c3a3c8c61abba9a9 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -63,11 +63,13 @@ void tmpsort(const struct userinfostruct *uinfo)
                order="-r";
 
        if (snprintf(arqin,sizeof(arqin),"%s/%s.utmp",tmp,uinfo->filename)>=sizeof(arqin)) {
-               debuga(_("File name too long: %s/%s.utmp\n"),tmp,uinfo->filename);
+               debuga(_("Path too long: "));
+               debuga_more("%s/%s.utmp\n",tmp,uinfo->filename);
                exit(EXIT_FAILURE);
        }
        if (snprintf(arqou,sizeof(arqou),"%s/htmlrel.txt",tmp)>=sizeof(arqou)) {
-               debuga(_("File name too long: %s/htmlrel.txt\n"),tmp);
+               debuga(_("Path too long: "));
+               debuga_more("%s/htmlrel.txt\n",tmp);
                exit(EXIT_FAILURE);
        }
 
@@ -76,7 +78,8 @@ void tmpsort(const struct userinfostruct *uinfo)
        }
 
        if (snprintf(csort,sizeof(csort),"sort -n -T \"%s\" -t \"\t\" %s -k %s -k %s -k %s -o \"%s\" \"%s\"",tmp,order,field1,field2,field3,arqou,arqin)>=sizeof(csort)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),arqin,arqou);
+               debuga(_("Command too long: "));
+               debuga_more("sort -n -T \"%s\" -t \"\t\" %s -k %s -k %s -k %s -o \"%s\" \"%s\"",tmp,order,field1,field2,field3,arqou,arqin);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
@@ -122,7 +125,10 @@ void sort_users_log(const char *tmp, int debug,struct userinfostruct *uinfo)
        clen=snprintf(csort,sizeof(csort),"sort -T \"%s\" -t \"\t\" -k 4,4 -k 1,1 -k 2,2 -o \"%s/%s.user_log\" \"%s/%s.user_unsort\"",
                        tmp, tmp, user, tmp, user);
        if (clen>=sizeof(csort)) {
-               debuga(_("user name too long to sort %s\n"),csort);
+               /* TRANSLATORS: The message is followed by the command that is too long. */
+               debuga(_("User name too long to sort with command "));
+               debuga_more("sort -T \"%s\" -t \"\t\" -k 4,4 -k 1,1 -k 2,2 -o \"%s/%s.user_log\" \"%s/%s.user_unsort\"",
+                       tmp, tmp, user, tmp, user);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
@@ -132,7 +138,8 @@ void sort_users_log(const char *tmp, int debug,struct userinfostruct *uinfo)
                exit(EXIT_FAILURE);
        }
        if (snprintf(csort,sizeof(csort),"%s/%s.user_unsort",tmp,user)>=sizeof(csort)) {
-               debuga(_("user name too long for %s/%s.user_unsort\n"),tmp,user);
+               debuga(_("User name too long to manufacture file name "));
+               debuga_more("%s/%s.user_unsort\n",tmp,user);
                exit(EXIT_FAILURE);
        }
        if (!KeepTempLog && unlink(csort)) {
index 7a30725d7afdfb6858eb5754685fa936adb721ab..160f14945ba43def00d236b5bf2d10974b60b16b 100644 (file)
@@ -67,7 +67,8 @@ void splitlog(const char *arq, const char *df, int dfrom, int duntil, int conver
                // '/' + '-YYYY-mm-dd' + '\0' == 13
                output_prefix_len=snprintf(output_file,sizeof(output_file)-12,"%s%s",outdir,splitprefix);
                if (output_prefix_len>=sizeof(output_file)-12) {
-                       debugapos("splitlog",_("Output path is too long: %s%s-YYYY-mm-dd\n"),outdir,splitprefix);
+                       debugapos("splitlog",_("Path too long: "));
+                       debuga_more("%s%s-YYYY-mm-dd\n",outdir,splitprefix);
                        exit(EXIT_FAILURE);
                }
                autosplit=1;
index 3fa0e6313c0d260a5f82aa257b0c65628a0c21b9..96efd9e1d82e42bb53a69e6b58c68f7db30e3e6e 100644 (file)
@@ -81,7 +81,8 @@ void topsites(void)
        sprintf(report,"%s/topsites.html",outdirname);
 
        if (snprintf(csort,sizeof(csort),"sort -t \"\t\" -k 4,4 -k 1,1 -o \"%s\" \"%s\"",general2,general)>=sizeof(csort)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),general,general2);
+               debuga(_("Command too long: "));
+               debuga_more("sort -t \"\t\" -k 4,4 -k 1,1 -o \"%s\" \"%s\"",general2,general);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
@@ -204,7 +205,8 @@ void topsites(void)
        }
 
        if (snprintf(csort,sizeof(csort),"sort -t \"\t\" %s -n %s -o \"%s\" \"%s\"",sortt,sortf,sites,general3)>=sizeof(csort)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),general3,sites);
+               debuga(_("Command too long: "));
+               debuga_more("sort -t \"\t\" %s -n %s -o \"%s\" \"%s\"",sortt,sortf,sites,general3);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
index 46baf8b4dec1583c42c50aaa6294becf63dda450..87eeed8e9ebe0da56fe65b4fd9a8b89a8caeda71 100644 (file)
--- a/topuser.c
+++ b/topuser.c
@@ -186,7 +186,8 @@ void topuser(void)
 
        snprintf(top1,sizeof(top1),"%s/top",outdirname);
        if (snprintf(csort,sizeof(csort),"sort -T \"%s\" -t \"\t\" %s %s -o \"%s\" \"%s\"", tmp, order, sfield, top1, top2)>=sizeof(csort)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),top2,top1);
+               debuga(_("Command too long: "));
+               debuga_more("sort -T \"%s\" -t \"\t\" %s %s -o \"%s\" \"%s\"", tmp, order, sfield, top1, top2);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
index 2bf80ce5c348a4725f981efead01a382031f7eda..3fcc58e15467e7cb480d02216b2fc2d25bcffad9 100644 (file)
--- a/totday.c
+++ b/totday.c
@@ -150,7 +150,8 @@ void day_totalize(DayObject ddata,const char *tmp, const struct userinfostruct *
        if (!ddata) return;
 
        if (snprintf(arqout,sizeof(arqout),"%s/%s.day",tmp,uinfo->filename)>=sizeof(arqout)) {
-               debuga(_("File name too long: %s/%s%s\n"),tmp,uinfo->filename,".day");
+               debuga(_("Path too long: "));
+               debuga_more("%s/%s%s\n",tmp,uinfo->filename,".day");
                exit(EXIT_FAILURE);
        }
 
index 2b4c7ab3e98524cd9547f1692a62ece869513cd8..763cd7ddc82e032834bf9dda21f0d50d888939e4 100644 (file)
@@ -133,7 +133,8 @@ void useragent(void)
        }
 
        if (snprintf(csort,sizeof(csort),"sort -n -t \"\t\" -k 3,3 -k 2,2 -k 1,1 -o \"%s\" \"%s\"",tmp2,tmp3)>=sizeof(csort)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),tmp2,tmp3);
+               debuga(_("Command too long: "));
+               debuga_more("sort -n -t \"\t\" -k 3,3 -k 2,2 -k 1,1 -o \"%s\" \"%s\"",tmp2,tmp3);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
@@ -216,7 +217,8 @@ void useragent(void)
        fclose(fp_in);
 
        if (snprintf(csort,sizeof(csort),"sort -t \"\t\" -k 2,2 -o \"%s\" \"%s\"",tmp3,tmp2)>=sizeof(csort)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),tmp2,tmp3);
+               debuga(_("Command too long: "));
+               debuga_more("sort -t \"\t\" -k 2,2 -o \"%s\" \"%s\"",tmp3,tmp2);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
@@ -285,7 +287,8 @@ void useragent(void)
        }
 
        if (snprintf(csort,sizeof(csort),"sort -n -r -k 1,1 -o \"%s\" \"%s\"",tmp3,tmp2)>=sizeof(csort)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),tmp2,tmp3);
+               debuga(_("Command too long: "));
+               debuga_more("sort -n -r -k 1,1 -o \"%s\" \"%s\"",tmp3,tmp2);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
diff --git a/util.c b/util.c
index 8249ef653668b2a6adeec2128f9ffaecfd08bc06..fac7600325b48b981a68d0b7896b5ac0085d8215 100644 (file)
--- a/util.c
+++ b/util.c
@@ -342,7 +342,8 @@ void my_mkdir(const char *name)
        chars=0;
        for (i=0 ; name[i] ; i++) {
                if (i>=sizeof(w0)) {
-                       debuga(_("Directory name too long: %s\n"),name);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s\n",name);
                        exit(EXIT_FAILURE);
                }
                if (chars>0 && name[i] == '/') {
@@ -482,6 +483,22 @@ void debuga(const char *msg,...)
        va_end(ap);
 }
 
+/*!
+Write a debug message to stderr. The message is supposed
+to be displayed after a message from debuga().
+
+\param msg The printf like message to format.
+\param ... The arguments to format in the message.
+*/
+void debuga_more(const char *msg,...)
+{
+       va_list ap;
+
+       va_start(ap,msg);
+       vfprintf(stderr,msg,ap);
+       va_end(ap);
+}
+
 /*!
 Write a debug message to stderr. The message is prefixed by "SARG:" to identify its origin.
 
@@ -971,7 +988,8 @@ static void copy_images(void)
        struct stat info;
 
        if (snprintf(images,sizeof(images),"%simages",outdir)>=sizeof(images)) {
-               debuga(_("Resulting target directory too long: %simages\n"),outdir);
+               debuga(_("Path too long: "));
+               debuga_more("%simages\n",outdir);
                exit(EXIT_FAILURE);
        }
        if (access(images,R_OK)!=0) {
@@ -1423,7 +1441,8 @@ void removetmp(const char *outdir)
                debuga(_("Purging temporary file sarg-general\n"));
        }
        if (snprintf(filename,sizeof(filename),"%s/sarg-general",outdir)>=sizeof(filename)) {
-               debugapos("removetmp",_("Directory too long: %s/sarg-period\n"),outdir);
+               debugapos("removetmp",_("Path too long: "));
+               debuga_more("%s/sarg-period\n",outdir);
                exit(EXIT_FAILURE);
        }
        if((fp_gen=fopen(filename,"w"))==NULL){
@@ -1883,7 +1902,8 @@ void unlinkdir(const char *dir,bool contentonly)
                    (direntp->d_name[1] == '.' && direntp->d_name[2] == '\0')))
                        continue;
                if (snprintf(dname,sizeof(dname),"%s/%s",dir,direntp->d_name)>=sizeof(dname)) {
-                       debuga(_("Directory name to delete too long: %s/%s\n"),dir,direntp->d_name);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s/%s\n",dir,direntp->d_name);
                        exit(EXIT_FAILURE);
                }
 #ifdef HAVE_LSTAT
@@ -1974,7 +1994,8 @@ void emptytmpdir(const char *dir)
                }
                
                if (snprintf(dname,sizeof(dname),"%s/%s",dir,direntp->d_name)>=sizeof(dname)) {
-                       debuga(_("Directory name to delete too long: %s/%s\n"),dir,direntp->d_name);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s/%s\n",dir,direntp->d_name);
                        exit(EXIT_FAILURE);
                }
                
@@ -2016,7 +2037,8 @@ void emptytmpdir(const char *dir)
                }
                
                if (snprintf(dname,sizeof(dname),"%s/%s",dir,direntp->d_name)>=sizeof(dname)) {
-                       debuga(_("Directory name to delete too long: %s/%s\n"),dir,direntp->d_name);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s/%s\n",dir,direntp->d_name);
                        exit(EXIT_FAILURE);
                }
 #ifdef HAVE_LSTAT