]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Simplify the messages to translate
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Wed, 1 Apr 2015 18:18:04 +0000 (20:18 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Wed, 1 Apr 2015 18:18:04 +0000 (20:18 +0200)
Translated messages that differ only in the file name printed at the
end of the message are now split in two parts. The file name is taken out
of the translated message to leave only the common part to be translated.

15 files changed:
auth.c
datafile.c
grepday.c
html.c
include/defs.h
index.c
lastlog.c
readlog.c
repday.c
report.c
smartfilter.c
sort.c
splitlog.c
totday.c
util.c

diff --git a/auth.c b/auth.c
index 3fd48080787c93d02d39323966cb575e54450cdc..57d352e182e46ed0c8f469ecab309a8717d35f21 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 1d4193c324c5ecb759ef780b3f4d524f82ec5473..1e4088f5b3987ef4848ac1e92e7c736b2572f07f 100644 (file)
@@ -86,7 +86,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)) {
-                       debuga(_("(datafile) directory path too long: %s/%s.user_log\n"),tmp,uinfo->filename);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s/%s.user_log\n",tmp,uinfo->filename);
                        exit(EXIT_FAILURE);
                }
 
index e7bc8cd224f43b1bff829a104a027822cd83e076..ab68c05c4b3737da3cb52e4eb3786dc6ceec7abc 100644 (file)
--- a/grepday.c
+++ b/grepday.c
@@ -610,7 +610,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) {
@@ -675,7 +677,8 @@ void greport_day(const struct userinfostruct *uinfo)
        if (datetimeby==0) return;
        if (!Graphs || GraphFont[0]=='\0') return;
        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) {
@@ -720,7 +723,8 @@ void greport_day(const struct userinfostruct *uinfo)
        fclose(fp_in);
 
        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 efdede7005e6179b02b847001b17fc4294898d5d..bba3f92153241f3bcc3cf54d94b8674b29a06ac1 100644 (file)
--- a/html.c
+++ b/html.c
@@ -70,12 +70,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);
        }
 
@@ -118,7 +120,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(_("Path too long: "));
+                       debuga_more("%s/%s\n",outdirname,uinfo->filename);
                        exit(EXIT_FAILURE);
                }
                if (!uinfo->topuser) {
@@ -146,11 +149,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)
@@ -368,7 +373,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);
                                }
 
index 8156606995eee5ab96be9c6f5f116da6b76c08ec..1d3dd061df2bba3c30aadbc9dacb9eeee50ca530 100644 (file)
@@ -375,6 +375,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 debugaz(const char *msg,...) __attribute__((format(printf,1,2)));
 void my_lltoa(unsigned long long int n, char *s, int ssize, int len);
 void url_module(const char *url, char *w2);
diff --git a/index.c b/index.c
index bed6f5b044e4b778fc62670702760e56f967bd5f..0c1cb62cb00463ce2d5c86193da7ca5a7ef1da98 100644 (file)
--- a/index.c
+++ b/index.c
@@ -148,7 +148,8 @@ static long long int get_size(char *path,int path_size)
 
        path_len=strlen(path);
        if (path_len+2>=path_size) {
-               debuga(_("Directory entry \"%s\" too long\n"),path);
+               debuga(_("Path too long: "));
+               debuga_more("%s\n",path);
                exit(EXIT_FAILURE);
        }
        if ((dirp=opendir(path))==NULL) {
@@ -160,7 +161,8 @@ static long long int get_size(char *path,int path_size)
                if (direntp->d_name[0]=='.' && (direntp->d_name[1]=='\0' || (direntp->d_name[1]=='.' && direntp->d_name[2]=='\0'))) continue;
                name_len=strlen(direntp->d_name);
                if (path_len+name_len+1>=path_size) {
-                       debuga(_("Directory entry \"%s%s\" too long\n"),path,direntp->d_name);
+                       debuga(_("Path too long "));
+                       debuga_more("%s%s\n",path,direntp->d_name);
                        exit(EXIT_FAILURE);
                }
                strcpy(path+path_len,direntp->d_name);
@@ -249,7 +251,8 @@ static long long int make_date_index_day(char *monthdir,int monthdir_size,int or
        }
        monthdir_len=strlen(monthdir);
        if (monthdir_len+strlen(INDEX_HTML_FILE)+2>=monthdir_size) {
-               debuga(_("Directory path too long: %s/%s\n"),monthdir,INDEX_HTML_FILE);
+               debuga(_("Path too long: "));
+               debuga_more("%s/%s\n",monthdir,INDEX_HTML_FILE);
                exit(EXIT_FAILURE);
        }
        monthdir[monthdir_len++]='/';
@@ -257,7 +260,8 @@ static long long int make_date_index_day(char *monthdir,int monthdir_size,int or
                if (direntp->d_name[0]=='.' && (direntp->d_name[1]=='\0' || (direntp->d_name[1]=='.' && direntp->d_name[2]=='\0'))) continue;
                name_len=strlen(direntp->d_name);
                if (monthdir_len+name_len+1>=monthdir_size) {
-                       debuga(_("Directory entry \"%s%s\" too long\n"),monthdir,direntp->d_name);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s%s\n",monthdir,direntp->d_name);
                        exit(EXIT_FAILURE);
                }
                strcpy(monthdir+monthdir_len,direntp->d_name);
@@ -407,7 +411,8 @@ static long long int make_date_index_month(char *yeardir,int yeardir_size,int or
        }
        yeardir_len=strlen(yeardir);
        if (yeardir_len+strlen(INDEX_HTML_FILE)+2>=yeardir_size) {
-               debuga(_("Directory path too long: %s/%s\n"),yeardir,INDEX_HTML_FILE);
+               debuga(_("Path too long: "));
+               debuga_more("%s/%s\n",yeardir,INDEX_HTML_FILE);
                exit(EXIT_FAILURE);
        }
        yeardir[yeardir_len++]='/';
@@ -415,7 +420,8 @@ static long long int make_date_index_month(char *yeardir,int yeardir_size,int or
                if (direntp->d_name[0]=='.' && (direntp->d_name[1]=='\0' || (direntp->d_name[1]=='.' && direntp->d_name[2]=='\0'))) continue;
                name_len=strlen(direntp->d_name);
                if (yeardir_len+name_len+1>=yeardir_size) {
-                       debuga(_("Directory entry \"%s%s\" too long\n"),yeardir,direntp->d_name);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s%s\n",yeardir,direntp->d_name);
                        exit(EXIT_FAILURE);
                }
                strcpy(yeardir+yeardir_len,direntp->d_name);
@@ -485,7 +491,8 @@ static long long int make_date_index_month(char *yeardir,int yeardir_size,int or
                }
                if (yeardir_len+strlen(monthnum)+1>=yeardir_size) {
                        yeardir[yeardir_len]='\0';
-                       debuga(_("Directory path too long: %s%s\n"),yeardir,monthnum);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s%s\n",yeardir,monthnum);
                        exit(EXIT_FAILURE);
                }
                strcpy(yeardir+yeardir_len,monthnum);
@@ -595,7 +602,8 @@ static void make_date_index(void)
 
        yeardirlen=strlen(outdir);
        if (yeardirlen>=sizeof(yeardir)) {
-               debuga(_("Output directory too long: %s"),outdir);
+               debuga(_("Path too long: "));
+               debuga_more("%s",outdir);
                exit(EXIT_FAILURE);
        }
        strcpy(yeardir,outdir);
index 43276f4e31707476ec2d3fa6bdbfb9ebad12ab45..7ce05209e3837b27c8a7ee85dda91efe440b6593 100644 (file)
--- a/lastlog.c
+++ b/lastlog.c
@@ -298,7 +298,8 @@ void mklastlog(const char *outdir)
                        debuga(_("Removing old report file %s\n"),ptr->Name);
                if (name_pos+strlen(ptr->Name)+1>=sizeof(warea)) {
                        DeleteDirList(List);
-                       debuga(_("Directory name too long: %s%s\n"),outdir,ptr->Name);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s%s\n",outdir,ptr->Name);
                        exit(EXIT_FAILURE);
                }
                strcpy(warea+name_pos,ptr->Name);
index 514ad07855e0bacd0814cdf9d169e0646ad7894b..b92406710806c3f87e81142405a85c7508664480 100644 (file)
--- a/readlog.c
+++ b/readlog.c
@@ -412,7 +412,8 @@ static void ReadOneLogFile(struct ReadLogDataStruct *Filter,const char *arq)
                                my_mkdir(ParsedOutputLog);
                        }
                        if (snprintf(SargLogFile,sizeof(SargLogFile),"%s/sarg_temp.log",ParsedOutputLog)>=sizeof(SargLogFile)) {
-                               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(SargLogFile,"w"))==NULL) {
@@ -801,7 +802,8 @@ int ReadLogFile(struct ReadLogDataStruct *Filter)
                strftime(val2,sizeof(val2),"%d%m%Y_%H%M",&period.start);
                strftime(val1,sizeof(val1),"%d%m%Y_%H%M",&period.end);
                if (snprintf(val4,sizeof(val4),"%s/sarg-%s-%s.log",ParsedOutputLog,val2,val1)>=sizeof(val4)) {
-                       debuga(_("File name too long: %s/sarg-%s-%s.log\n"),ParsedOutputLog,val2,val1);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s/sarg-%s-%s.log\n",ParsedOutputLog,val2,val1);
                        exit(EXIT_FAILURE);
                }
                if (rename(SargLogFile,val4)) {
index af8e8f9516322f6e556ec019e2ed33159b555176..54ac69122f424a205cf4045b4cd8c2299d649e54 100644 (file)
--- a/repday.c
+++ b/repday.c
@@ -62,7 +62,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 5701528e3e01e9ed6e176dd389577a603eb3dc80..b0f95402f590c1cbbdcef525b914f5f5cac3b7e3 100644 (file)
--- a/report.c
+++ b/report.c
@@ -444,7 +444,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);
        }
 
@@ -491,7 +492,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);
        }
 
@@ -778,7 +780,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 for %s/smartfilter.int_unsort\n"),dirname);
+               debuga(_("Path too long: "));
+               debuga_more("%s/smartfilter.int_unsort\n",dirname);
                exit(EXIT_FAILURE);
        }
 
index 194736f2eecd787cbd4c493fede999c3cf29a4b8..7b9a9dab5fce01eea103490a09d109cbb31cc0f5 100644 (file)
@@ -53,19 +53,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 b7f228e073c5403aacdf790d75ae4fd4274a72cc..43c0857056a692c72b3985bd9f444587c4f8a836 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);
        }
 
@@ -122,7 +124,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 +137,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 dc2e1386bd67ab4b691d98c2f021be4062c34f83..b55c721ad3712e95683d72a68a5ce3a84abe6634 100644 (file)
@@ -67,7 +67,8 @@ void splitlog(const char *arq, char df, int dfrom, int duntil, int convert, cons
                // '/' + '-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) {
-                       debuga(_("(splitlog) Output path is too long: %s%s-YYYY-mm-dd\n"),outdir,splitprefix);
+                       debuga(_("Path too long: "));
+                       debuga_more("%s%s-YYYY-mm-dd\n",outdir,splitprefix);
                        exit(EXIT_FAILURE);
                }
                autosplit=1;
index 0ebf46bd3308eb73a89f9e2cc3871014afeabf0e..e59981134574ff45964333ef741c28465b864299 100644 (file)
--- a/totday.c
+++ b/totday.c
@@ -151,7 +151,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);
        }
 
@@ -197,7 +198,8 @@ void day_deletefile(const struct userinfostruct *uinfo)
        if (KeepTempLog) 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);
        }
 
diff --git a/util.c b/util.c
index a741c7a9dee2fb2f4870f4ab72c7d715e24a2d85..d33a88dc1ead0e65a2afa0d38bc8755ee170b40a 100644 (file)
--- a/util.c
+++ b/util.c
@@ -414,7 +414,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] == '/') {
@@ -557,6 +558,21 @@ 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: (info)".
@@ -746,12 +762,14 @@ int obtdate(const char *dirname, const char *name, char *data)
        char wdir[MAXLEN];
 
        if (snprintf(wdir,sizeof(wdir),"%s%s/sarg-date",dirname,name)>=sizeof(wdir)) {
-               debuga(_("Buffer to small to store %s%s/sarg-date"),dirname,name);
+               debuga(_("Buffer too small to store "));
+               debuga_more("%s%s/sarg-date",dirname,name);
                exit(EXIT_FAILURE);
        }
        if ((fp_in = fopen(wdir, "rt")) == 0) {
                if (snprintf(wdir,sizeof(wdir),"%s%s/date",dirname,name)>=sizeof(wdir)) {
-                       debuga(_("Buffer to small to store %s%s/date"),dirname,name);
+                       debuga(_("Buffer too small to store "));
+                       debuga_more("%s%s/date",dirname,name);
                        exit(EXIT_FAILURE);
                }
                if ((fp_in = fopen(wdir, "rt")) == 0) {
@@ -809,12 +827,14 @@ int obtuser(const char *dirname, const char *name)
        int nuser;
 
        if (snprintf(wdir,sizeof(wdir),"%s%s/sarg-users",dirname,name)>=sizeof(wdir)) {
-               debuga(_("Buffer too small to store %s%s/sarg-users"),dirname,name);
+               debuga(_("Buffer too small to store "));
+               debuga_more("%s%s/sarg-users",dirname,name);
                exit(EXIT_FAILURE);
        }
        if((fp_in=fopen(wdir,"r"))==NULL) {
                if (snprintf(wdir,sizeof(wdir),"%s%s/users",dirname,name)>=sizeof(wdir)) {
-                       debuga(_("Buffer too small to store %s%s/users"),dirname,name);
+                       debuga(_("Buffer too small to store "));
+                       debuga_more("%s%s/users",dirname,name);
                        exit(EXIT_FAILURE);
                }
                if((fp_in=fopen(wdir,"r"))==NULL) {
@@ -847,12 +867,14 @@ void obttotal(const char *dirname, const char *name, int nuser, long long int *t
        *media=0;
 
        if (snprintf(wdir,sizeof(wdir),"%s%s/sarg-general",dirname,name)>=sizeof(wdir)) {
-               debuga(_("Buffer too small to store %s%s/sarg-general"),dirname,name);
+               debuga(_("Buffer too small to store "));
+               debuga_more("%s%s/sarg-general",dirname,name);
                exit(EXIT_FAILURE);
        }
        if ((fp_in = fopen(wdir, "r")) == 0) {
                if (snprintf(wdir,sizeof(wdir),"%s%s/general",dirname,name)>=sizeof(wdir)) {
-                       debuga(_("Buffer too small to store %s%s/general"),dirname,name);
+                       debuga(_("Buffer too small to store "));
+                       debuga_more("%s%s/general",dirname,name);
                        exit(EXIT_FAILURE);
                }
                if ((fp_in = fopen(wdir, "r")) == 0) {
@@ -1074,7 +1096,8 @@ static void copy_images(void)
                if(direntp->d_name[0]=='.')
                        continue;
                if (snprintf(srcfile,sizeof(srcfile),"%s/%s",ImageDir,direntp->d_name)>=sizeof(srcfile)) {
-                       debuga(_("Buffer too small to store %s/%s"),ImageDir,direntp->d_name);
+                       debuga(_("Buffer too small to store "));
+                       debuga_more("%s/%s",ImageDir,direntp->d_name);
                        exit(EXIT_FAILURE);
                }
                if (stat(srcfile,&info)) {
@@ -1083,7 +1106,8 @@ static void copy_images(void)
                }
                if (S_ISREG(info.st_mode)) {
                        if (snprintf(dstfile,sizeof(dstfile),"%s/%s",images,direntp->d_name)>=sizeof(dstfile)) {
-                               debuga(_("Buffer too small to store %s/%s"),images,direntp->d_name);
+                               debuga(_("Buffer too small to store "));
+                               debuga_more("%s/%s",images,direntp->d_name);
                                exit(EXIT_FAILURE);
                        }
                        img_in = fopen(srcfile, "rb");
@@ -1393,7 +1417,8 @@ int vrfydir(const struct periodstruct *per1, const char *addr, const char *site,
        strcpy(dirname2,wdir);
 
        if (snprintf(wdir,sizeof(wdir),"%s/sarg-date",outdirname)>=sizeof(wdir)) {
-               debuga(_("Buffer too small to store %s/sarg-date"),outdirname);
+               debuga(_("Buffer too small to store "));
+               debuga_more("%s/sarg-date",outdirname);
                exit(EXIT_FAILURE);
        }
        if ((fp_ou = fopen(wdir, "wt")) == 0) {
@@ -1679,7 +1704,8 @@ void removetmp(const char *outdir)
                debuga(_("Purging temporary file sarg-general\n"));
        }
        if (snprintf(filename,sizeof(filename),"%s/sarg-general",outdir)>=sizeof(filename)) {
-               debuga(_("(removetmp) directory too long to remove %s/sarg-period\n"),outdir);
+               debuga(_("Path too long: "));
+               debuga_more("%s/sarg-period\n",outdir);
                exit(EXIT_FAILURE);
        }
        if((fp_gen=fopen(filename,"w"))==NULL){
@@ -2132,7 +2158,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
@@ -2225,7 +2252,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);
                }
 
@@ -2267,7 +2295,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