]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Produce less messages to be translated
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Mon, 22 Dec 2014 12:29:08 +0000 (13:29 +0100)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Mon, 22 Dec 2014 12:29:08 +0000 (13:29 +0100)
There are too many redundant messages to translate. It makes the translator
task tedious.

This change removes the source particle from the message. It makes several
messages identical. The source particle is displayed in a non translatable
string.

Some more messages have been made identical across the sources.

31 files changed:
auth.c
authfail.c
convlog.c
dansguardian_log.c
dansguardian_report.c
datafile.c
denied.c
download.c
email.c
exclude.c
getconf.c
grepday.c
html.c
include/defs.h
index.c
indexonly.c
lastlog.c
log.c
realtime.c
redirector.c
repday.c
report.c
siteuser.c
smartfilter.c
splitlog.c
topsites.c
topuser.c
totday.c
useragent.c
usertab.c
util.c

diff --git a/auth.c b/auth.c
index af3dd233ed70d50a115326eb015e275ab98dcca0..5bd23dad075458a49b457641b845f2f6f33a2040 100644 (file)
--- a/auth.c
+++ b/auth.c
@@ -43,12 +43,12 @@ void htaccess(const struct userinfostruct *uinfo)
                exit(EXIT_FAILURE);
        }
        if((fp_auth=fopen(htname,"w"))==NULL) {
-               debuga(_("(auth) Cannot open file: %s - %s\n"),htname,strerror(errno));
+               debugapos("auth",_("Cannot open file \"%s\": %s\n"),htname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if ((fp_in=fopen(AuthUserTemplateFile,"r"))==NULL) {
-               debuga(_("(auth) Cannot open template file: %s - %s\n"),AuthUserTemplateFile,strerror(errno));
+               debugapos("auth",_("Cannot open file \"%s\": %s\n"),AuthUserTemplateFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index 685c64cf64b240766b536f39b599d96374e02b5d..9d14ef0175bca0a6e6d01f2dfcea7c437cb9caad 100644 (file)
@@ -89,7 +89,7 @@ void authfail_report(void)
                exit(EXIT_FAILURE);
        }
        if((fp_in=MY_FOPEN(authfail_in,"r"))==NULL) {
-               debuga(_("(authfail) Cannot open file %s\n"),authfail_in);
+               debugapos("authfail",_("Cannot open file \"%s\": %s\n"),authfail_in,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
@@ -99,7 +99,7 @@ void authfail_report(void)
        }
 
        if((fp_ou=MY_FOPEN(report,"w"))==NULL) {
-               debuga(_("(authfail) Cannot open file %s\n"),report);
+               debugapos("authfail",_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -204,7 +204,7 @@ void authfail_report(void)
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in file %s\n"),report);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),report,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
 
        if (!KeepTempLog && unlink(authfail_in)) {
                debuga(_("Cannot delete \"%s\": %s\n"),authfail_in,strerror(errno));
index ee72ccc431981066f6c98b15e1caa53ed568cb10..e05204a04a1372ef3426732f9cf1a72c422cd96a 100644 (file)
--- a/convlog.c
+++ b/convlog.c
@@ -45,7 +45,7 @@ void convlog(const char *arq, char *df, int dfrom, int duntil)
        if (arq[0]=='-' && arq[1]=='\0') {
                fp_in=stdin;
        } else if((fp_in=MY_FOPEN(arq,"r"))==NULL) {
-               debuga(_("(convlog) Cannot open log file %s - %s\n"),arq,strerror(errno));
+               debugapos("convlog",_("Cannot open file \"%s\": %s\n"),arq,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -79,6 +79,6 @@ void convlog(const char *arq, char *df, int dfrom, int duntil)
 
        longline_destroy(&line);
        if (fp_in!=stdin && fclose(fp_in)==EOF) {
-               debuga(_("Failed to close file %s - %s\n"),arq,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),arq,strerror(errno));
        }
 }
index ea3c127d0a2418021d37c16ad5197402702f51c7..d3786d173183c15de29bd8235dd4d26557ecd2d7 100644 (file)
@@ -58,12 +58,12 @@ void dansguardian_log(void)
        }
 
        if((fp_guard=fopen(DansGuardianConf,"r"))==NULL) {
-               debuga(_("(dansguardian) Cannot open log file: %s\n"),DansGuardianConf);
+               debugapos("dansguardian",_("Cannot open file \"%s\": %s\n"),DansGuardianConf,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=MY_FOPEN(guard_in,"a"))==NULL) {
-               debuga(_("(dansguardian) Cannot open log file: %s\n"),guard_in);
+               debugapos("dansguardian",_("Cannot open file \"%s\": %s\n"),guard_in,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -87,7 +87,7 @@ void dansguardian_log(void)
                debuga(_("Reading DansGuardian log file: %s\n"),loglocation);
 
        if((fp_in=MY_FOPEN(loglocation,"r"))==NULL) {
-               debuga(_("(dansguardian) Cannot open log file: %s\n"),loglocation);
+               debugapos("dansguardian",_("Cannot open file \"%s\": %s\n"),loglocation,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index e98d8923d0905271124d70eaaa5e3a0662c0916d..e8a62d2575a7258610c8916607176b0e4bcc8e89 100644 (file)
@@ -69,12 +69,12 @@ void dansguardian_report(void)
        sprintf(report,"%s/dansguardian.html",outdirname);
 
        if((fp_in=MY_FOPEN(dansguardian_in,"r"))==NULL) {
-               debuga(_("(dansguardian_report) Cannot open log file %s\n"),dansguardian_in);
+               debugapos("dansguardian_report",_("Cannot open file \"%s\": %s\n"),dansguardian_in,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=MY_FOPEN(report,"w"))==NULL) {
-               debuga(_("(dansguardian_report) Cannot open log file %s\n"),report);
+               debugapos("dansguardian_report",_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -168,7 +168,7 @@ void dansguardian_report(void)
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in file %s\n"),report);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),report,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
 
        if (!KeepTempLog && unlink(dansguardian_in)) {
                debuga(_("Cannot delete \"%s\": %s\n"),dansguardian_in,strerror(errno));
index 879febc24c8552512b5f7c98c2822e60e2a5fb32..6d20b43ce453923eacdb4767bffdfafec3fceb50 100644 (file)
@@ -84,12 +84,12 @@ 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);
+                       debugapos("datafile",_("Directory path too long: %s/%s.user_log\n"),tmp,uinfo->filename);
                        exit(EXIT_FAILURE);
                }
 
                if((fp_in=MY_FOPEN(tmp3,"r"))==NULL){
-                       debuga(_("(datafile) Cannot open file %s\n"),tmp3);
+                       debugapos("datafile",_("Cannot open file \"%s\": %s\n"),tmp3,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
@@ -145,7 +145,7 @@ void data_file(char *tmp)
 
                        if(!same_url || new_user){
                                if(!fp_ou && (fp_ou=MY_FOPEN(DataFile,"w"))==NULL){
-                                       debuga(_("(datafile) Cannot open file %s\n"),DataFile);
+                                       debugapos("datafile",_("Cannot open file \"%s\": %s\n"),DataFile,strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
                                saverecs(fp_ou,uinfo,nacc,oldurl,nbytes,oldaccip,oldacchora,oldaccdia,nelap,incache,oucache);
index e5dbae1f387075a93bf3df7b087708884b2569f1..40fabad7f2667b56588aca5a6aee296cee48df3f 100644 (file)
--- a/denied.c
+++ b/denied.c
@@ -73,12 +73,12 @@ void gen_denied_report(void)
        sprintf(report,"%s/denied.html",outdirname);
 
        if((fp_in=MY_FOPEN(denied_in,"r"))==NULL) {
-               debuga(_("(denied) Cannot open log file %s\n"),denied_in);
+               debugapos("denied",_("Cannot open file \"%s\": %s\n"),denied_in,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=MY_FOPEN(report,"w"))==NULL) {
-               debuga(_("(denied) Cannot open log file %s\n"),report);
+               debugapos("denied",_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -175,7 +175,7 @@ void gen_denied_report(void)
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in file %s\n"),report);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),report,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
 
        if (!KeepTempLog && unlink(denied_in)==-1)
                debuga(_("Cannot delete \"%s\": %s\n"),denied_in,strerror(errno));
index c5c509699f547f90565910761cc7ca49cff581eb..3987b5092c80b34653916b858a940c85e1966c3f 100644 (file)
@@ -130,12 +130,12 @@ void download_report(void)
        snprintf(report,sizeof(report),"%s/download.html",outdirname);
 
        if((fp_in=MY_FOPEN(report_in,"r"))==NULL) {
-               debuga(_("(download) Cannot open log file %s\n"),report_in);
+               debugapos("download",_("Cannot open file \"%s\": %s\n"),report_in,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=MY_FOPEN(report,"w"))==NULL) {
-               debuga(_("(download) Cannot open log file %s\n"),report);
+               debugapos("download",_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -228,7 +228,7 @@ void download_report(void)
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in file %s\n"),report);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),report,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
 
        if (!KeepTempLog && unlink(report_in)) {
                debuga(_("Cannot delete \"%s\": %s\n"),report_in,strerror(errno));
diff --git a/email.c b/email.c
index eb42b62a9707283f44aed70f995ff144d74422ea..ea508066f10ccb195ba28d2c83bbb29f35f08a80 100644 (file)
--- a/email.c
+++ b/email.c
@@ -58,19 +58,19 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema
 
        snprintf(wger,sizeof(wger),"%s/sarg-general",dirname);
        if((fp_in=fopen(wger,"r"))==NULL) {
-               debuga(_("(email) Cannot open file %s\n"),wger);
+               debugapos("email",_("Cannot open file \"%s\": %s\n"),wger,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        snprintf(top1,sizeof(top1),"%s/top",dirname);
        if((fp_top1=fopen(top1,"w"))==NULL) {
-               debuga(_("(email) Cannot open file %s\n"),top1);
+               debugapos("email",_("Cannot open file \"%s\": %s\n"),top1,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        snprintf(top2,sizeof(top2),"%s/top.tmp",dirname);
        if((fp_top2=fopen(top2,"w"))==NULL) {
-               debuga(_("(email) Cannot open file %s\n"),top2);
+               debugapos("email",_("Cannot open file \"%s\": %s\n"),top2,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -148,13 +148,13 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema
        }
 
        if((fp_top1=fopen(top1,"r"))==NULL) {
-               debuga(_("(email) Cannot open file %s\n"),top1);
+               debugapos("email",_("Cannot open file \"%s\": %s\n"),top1,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        snprintf(top3,sizeof(top3),"%s/report",dirname);
        if((fp_top3=fopen(top3,"w"))==NULL) {
-               debuga(_("(email) Cannot open file %s\n"),top3);
+               debugapos("email",_("Cannot open file \"%s\": %s\n"),top3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -266,7 +266,7 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema
 
        if(strcmp(email,"stdout") == 0) {
                if((fp_top3=fopen(top3,"r"))==NULL) {
-                       debuga(_("(email) Cannot open file %s\n"),top3);
+                       debugapos("email",_("Cannot open file \"%s\": %s\n"),top3,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
index e6274544dd9f3ec850bc1ba70acc1e4946efadb7..d1cb0385a5b4e8279527ce252c4a2f268c285646 100644 (file)
--- a/exclude.c
+++ b/exclude.c
@@ -193,14 +193,14 @@ void gethexclude(const char *hexfile, int debug)
        const char *next;
 
        if(access(hexfile, R_OK) != 0) {
-               debuga(_("Cannot open exclude_hosts file: %s - %s\n"),hexfile,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),hexfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
        if(debug)
                debuga(_("Loading exclude host file from: %s\n"),hexfile);
 
        if ((fp_ex = fopen(hexfile, "r")) == NULL) {
-               debuga(_("(gethexclude) Cannot open file %s - %s\n"),hexfile,strerror(errno));
+               debugapos("gethexclude",_("Cannot open file \"%s\": %s\n"),hexfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -314,7 +314,7 @@ void getuexclude(const char *uexfile, int debug)
                debuga(_("Loading exclude file from: %s\n"),uexfile);
 
        if ((fp_ex = fopen(uexfile, "r")) == NULL) {
-               debuga(_("(gethexclude) Cannot open file %s - %s\n"),uexfile,strerror(errno));
+               debugapos("gethexclude",_("Cannot open file \"%s\": %s\n"),uexfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -329,7 +329,7 @@ void getuexclude(const char *uexfile, int debug)
        }
        nreg += 11;
        if (fseek(fp_ex, 0, SEEK_SET)==-1) {
-               debuga(_("Failed to rewind the excluded users file %s: %s\n"),uexfile,strerror(errno));
+               debuga(_("Failed to rewind file \"%s\": %s\n"),uexfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index 79c7130949fc29480d9feda24224541c3f4c3f4b..2b9aaaf611cf45949d525c195ab589fd3080519f 100644 (file)
--- a/getconf.c
+++ b/getconf.c
@@ -784,7 +784,7 @@ void getconf(void)
                debuga(_("Loading configuration from %s\n"),ConfigFile);
 
        if ((fp_in = fopen(ConfigFile, "r")) == NULL) {
-               debuga(_("(getconf) Cannot open file %s\n"),ConfigFile);
+               debugapos("getconf",_("Cannot open file \"%s\": %s\n"),ConfigFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index b0d89087d61addf69bc613cf02445a51a6b67bf3..c9ed6e509de9d3a5bf079543679f5ff7335086f7 100644 (file)
--- a/grepday.c
+++ b/grepday.c
@@ -154,7 +154,10 @@ static void Sarg_gdImageStringFT (struct GraphDataStruct *gdata, int fg, char *f
                str = string;
                sstr = sstring;
                if (iconv (localtoutf, (ICONV_CONST char **)&str, &slen, &sstr, &sslen)==-1) {
-                       debuga(_("(grepday) iconv failed to convert string \"%s\" from %s to UTF-8 - %s\n"),string,CharSet,strerror(errno));
+                       /* TRANSLATORS: First %s is the string that failed to convert. Second %s is the input
+                        * character encoding. Last %s is the reason for the failure.
+                        */
+                       debugapos("grepday",_("iconv failed to convert string \"%s\" from %s to UTF-8: %s\n"),string,CharSet,strerror(errno));
                        sstring=(char *)string; //show something sensible on the graph
                }
        } else {
@@ -614,7 +617,7 @@ static void greport_plot(const struct userinfostruct *uinfo,struct PlotStruct *p
                exit(EXIT_FAILURE);
        }
        if((pngout=fopen(graph,"wb"))==NULL) {
-               debuga(_("(grepday) Cannot open log file %s\n"),graph);
+               debugapos("grepday",_("Cannot open file \"%s\": %s\n"),graph,strerror(errno));
                exit(EXIT_FAILURE);
        }
        gdImagePng(gdata.im, pngout);
@@ -630,25 +633,33 @@ void greport_prepare(void)
 {
 #ifdef HAVE_GD
        if (!Graphs) {
-               if (debugz)
-                       debugaz(_("Graphs disabled as requested in %s\n"),ConfigFile);
+               if (debugz) {
+                       /* TRANSLATORS: %s is the name of the configuration file providing
+                        * the graph option.
+                        */
+                       debugaz(_("Graphs disabled as requested in \"%s\"\n"),ConfigFile);
+               }
                return;
        }
        if (GraphFont[0]=='\0') {
-               if (debugz)
-                       debugaz(_("Graphs disabled as no font names were provided in %s\n"),ConfigFile);
+               if (debugz) {
+                       /* TRANSLATORS: %s is the name of the configuration file providing
+                        * the graph option.
+                        */
+                       debugaz(_("Graphs disabled as no font names were provided in \"%s\"\n"),ConfigFile);
+               }
                return;
        }
 
        if(access(GraphFont, R_OK) != 0) {
-               debuga(_("(grepday) Fontname %s not found\n"),GraphFont);
+               debugapos("grepday",_("Fontname \"%s\" not found\n"),GraphFont);
                exit(EXIT_FAILURE);
        }
 
 #ifdef USE_ICONV
        localtoutf = iconv_open ("UTF-8", CharSet);
        if (localtoutf==(iconv_t)-1) {
-               debuga(_("(grepday) iconv cannot convert from %s to UTF-8 - %s\n"),CharSet,strerror(errno));
+               debugapos("grepday",_("iconv cannot convert from %s to UTF-8: %s\n"),CharSet,strerror(errno));
        }
 #endif
 
@@ -684,7 +695,7 @@ void greport_day(const struct userinfostruct *uinfo)
        }
 
        if((fp_in=fopen(wdirname,"r"))==NULL) {
-               debuga(_("(grepday) Cannot open log file %s\n"),wdirname);
+               debugapos("grepday",_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -729,7 +740,7 @@ void greport_day(const struct userinfostruct *uinfo)
                exit(EXIT_FAILURE);
        }
        if ((fp_ou=fopen(wdirname,"wt"))==NULL) {
-               debuga(_("(grepday) Cannot open output file %s\n"),wdirname);
+               debugapos("grepday",_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
        write_html_head(fp_ou,(IndexTree == INDEX_TREE_DATE) ? 4 : 2,_("Graph report"),HTML_JS_NONE);
@@ -766,7 +777,7 @@ void greport_day(const struct userinfostruct *uinfo)
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in file %s\n"),wdirname);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),wdirname,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),wdirname,strerror(errno));
 #endif //HAVE_GD
 
        return;
diff --git a/html.c b/html.c
index 5f7a4f21611537b6be6fc689d0bb75a977784fcd..ed6aba9e274cecd150f6a11f3a03c2fa85cfc1c3 100644 (file)
--- a/html.c
+++ b/html.c
@@ -107,7 +107,7 @@ void htmlrel(void)
                }
                if ((fp_in = fopen(arqin, "r")) == 0){
                        if (uinfo->no_report) continue;
-                       debuga(_("(html3) Cannot open file %s\n"),arqin);
+                       debugapos("html3",_("Cannot open file \"%s\": %s\n"),arqin,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
@@ -174,7 +174,7 @@ void htmlrel(void)
                rewind(fp_in);
 
                if ((fp_ou = fopen(arqou, "w")) == 0){
-                       debuga(_("(html5) Cannot open file %s\n"),arqou);
+                       debugapos("html5",_("Cannot open file \"%s\": %s\n"),arqou,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
@@ -337,17 +337,17 @@ void htmlrel(void)
                                }
 
                                if ((fp_ip = fopen(arqip, "r")) == 0){
-                                       debuga(_("(html6) Cannot open file %s\n"),arqip);
+                                       debugapos("html6",_("Cannot open file \"%s\": %s\n"),arqip,strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
 
                                if ((fp_ip2 = MY_FOPEN(tmp2, "a")) == 0){
-                                       debuga(_("(html7) Cannot open file %s\n"),tmp2);
+                                       debugapos("html7",_("Cannot open file \"%s\": %s\n"),tmp2,strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
 
                                if ((line1=longline_create())==NULL) {
-                                       debuga(_("Not enough memory to read file %s\n"),arqip);
+                                       debuga(_("Not enough memory to read file \"%s\"\n"),arqip);
                                        exit(EXIT_FAILURE);
                                }
                                while((buf=longline_read(fp_ip,line1))!=NULL) {
@@ -396,7 +396,7 @@ void htmlrel(void)
                                }
 
                                if ((fp_ip = MY_FOPEN(tmp3, "r")) == 0) {
-                                       debuga(_("(html8) Cannot open file %s\n"),tmp3);
+                                       debugapos("html8",_("Cannot open file \"%s\": %s\n"),tmp3,strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
 
@@ -530,7 +530,7 @@ void htmlrel(void)
                                limit_flag=0;
                                if(access(PerUserLimitFile, R_OK) == 0) {
                                        if((fp_usr = fopen(PerUserLimitFile, "r")) == 0) {
-                                               debuga(_("(html9) Cannot open file %s\n"),PerUserLimitFile);
+                                               debugapos("html9",_("Cannot open file \"%s\": %s\n"),PerUserLimitFile,strerror(errno));
                                                exit(EXIT_FAILURE);
                                        }
                                        while(fgets(tmp6,sizeof(tmp6),fp_usr)!=NULL) {
@@ -545,7 +545,7 @@ void htmlrel(void)
 
                                if(!limit_flag) {
                                        if((fp_usr = fopen(PerUserLimitFile, "a")) == 0) {
-                                               debuga(_("(html10) Cannot open file %s\n"),PerUserLimitFile);
+                                               debugapos("html10",_("Cannot open file \"%s\": %s\n"),PerUserLimitFile,strerror(errno));
                                                exit(EXIT_FAILURE);
                                        }
                                        fprintf(fp_usr,"%s\n",uinfo->ip);
@@ -583,9 +583,9 @@ void htmlrel(void)
 
                fputs("</table></div>\n",fp_ou);
                if (write_html_trailer(fp_ou)<0)
-                       debuga(_("Write error in file %s\n"),arqou);
+                       debuga(_("Write error in file \"%s\"\n"),arqou);
                if (fclose(fp_ou)==EOF)
-                       debuga(_("Failed to close file %s - %s\n"),arqou,strerror(errno));
+                       debuga(_("Failed to close file \"%s\": %s\n"),arqou,strerror(errno));
 
                htaccess(uinfo);
        }
index e991750bb08af35fea6ffd30359130898db38ac8..3828cff4cae79514dde77e22d0668075b03b61cd 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 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);
 char *get_size(const char *path, const char *file);
diff --git a/index.c b/index.c
index 19ec04f95324805b50bd57685dfbfb8f33b7e3db..04275c3d8d5f8f2656f8307ab9ba5ffaeab19397 100644 (file)
--- a/index.c
+++ b/index.c
@@ -55,7 +55,7 @@ void make_index(void)
 
        // convert any old report hierarchy
        if ((dirp = opendir(outdir)) == NULL) {
-               debuga(_("Failed to open directory %s - %s\n"),outdir,strerror(errno));
+               debuga(_("Failed to open directory \"%s\": %s\n"),outdir,strerror(errno));
                exit(EXIT_FAILURE);
        }
        while ((direntp = readdir( dirp )) != NULL) {
@@ -109,7 +109,7 @@ static void make_date_index(void)
 
        nyears=0;
        if ((dirp = opendir(outdir)) == NULL) {
-               debuga(_("Failed to open directory %s - %s\n"),outdir,strerror(errno));
+               debuga(_("Failed to open directory \"%s\": %s\n"),outdir,strerror(errno));
                exit(EXIT_FAILURE);
        }
        while ((direntp = readdir( dirp )) != NULL) {
@@ -140,7 +140,7 @@ static void make_date_index(void)
        order=(strcmp(IndexSortOrder,"A") == 0) ? 1 : -1;
 
        if((fp_ou=fopen(yearindex,"w"))==NULL) {
-               debuga(_("(index) Cannot open file %s - %s\n"),yearindex,strerror(errno));
+               debugapos("index",_("Cannot open file \"%s\": %s\n"),yearindex,strerror(errno));
                exit(EXIT_FAILURE);
        }
        write_html_header(fp_ou,0,ngettext("SARG report","SARG reports",nyears),HTML_JS_NONE);
@@ -164,7 +164,7 @@ static void make_date_index(void)
                // Year dir
                nmonths=0;
                if ((dirp2 = opendir(yeardir)) == NULL) {
-                       debuga(_("Failed to open directory %s - %s\n"),yeardir,strerror(errno));
+                       debuga(_("Failed to open directory \"%s\": %s\n"),yeardir,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                while ((direntp2 = readdir( dirp2 )) != NULL) {
@@ -192,7 +192,7 @@ static void make_date_index(void)
                closedir(dirp2);
                sprintf(monthindex,"%s/index.html",yeardir);
                if((fp_ou2=fopen(monthindex,"w"))==NULL) {
-                       debuga(_("(index) Cannot open file %s - %s\n"),monthindex,strerror(errno));
+                       debugapos("index",_("Cannot open file \"%s\": %s\n"),monthindex,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                snprintf(title,sizeof(title),ngettext("SARG: report for %04d","SARG: reports for %04d",nmonths),year);
@@ -225,7 +225,7 @@ static void make_date_index(void)
                        // month dir
                        ndays=0;
                        if ((dirp3 = opendir(monthdir)) == NULL) {
-                               debuga(_("Failed to open directory %s - %s\n"),monthdir,strerror(errno));
+                               debuga(_("Cannot open directory \"%s\": %s\n"),monthdir,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                        while ((direntp3 = readdir( dirp3 )) != NULL) {
@@ -253,7 +253,7 @@ static void make_date_index(void)
                        closedir(dirp3);
                        sprintf(dayindex,"%s/index.html",monthdir);
                        if((fp_ou3=fopen(dayindex,"w"))==NULL) {
-                               debuga(_("(index) Cannot open file %s - %s\n"),dayindex,strerror(errno));
+                               debugapos("index",_("Cannot open file \"%s\": %s\n"),dayindex,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                        snprintf(title,sizeof(title),ngettext("SARG: report for %04d/%02d","SARG: reports for %04d/%02d",ndays),year,month);
@@ -279,20 +279,20 @@ static void make_date_index(void)
                        if (write_html_trailer(fp_ou3)<0)
                                debuga(_("Write error in the index %s\n"),dayindex);
                        if (fclose(fp_ou3)==EOF)
-                               debuga(_("Failed to close the index file %s - %s\n"),dayindex,strerror(errno));
+                               debuga(_("Failed to close file \"%s\": %s\n"),dayindex,strerror(errno));
                }
                fputs("</table></div>\n",fp_ou2);
                if (write_html_trailer(fp_ou2)<0)
                        debuga(_("Write error in the index %s\n"),monthindex);
                if (fclose(fp_ou2)==EOF)
-                       debuga(_("Failed to close the index file %s - %s\n"),monthindex,strerror(errno));
+                       debuga(_("Failed to close file \"%s\": %s\n"),monthindex,strerror(errno));
        }
 
        fputs("</table></div>\n",fp_ou);
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in the index %s\n"),yearindex);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close the index file %s - %s\n"),yearindex,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),yearindex,strerror(errno));
 }
 
 static void make_file_index(void)
@@ -327,7 +327,7 @@ static void make_file_index(void)
        order=(strcmp(IndexSortOrder,"A") == 0) ? 1 : -1;
 
        if ((dirp = opendir(outdir)) == NULL) {
-               debuga(_("Failed to open directory %s - %s\n"),outdir,strerror(errno));
+               debuga(_("Cannot open directory \"%s\": %s\n"),outdir,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -421,7 +421,7 @@ static void make_file_index(void)
        closedir( dirp );
 
        if((fp_ou=fopen(wdir,"w"))==NULL) {
-               debuga(_("(index) Cannot open file %s\n"),wdir);
+               debugapos("index",_("Cannot open file \"%s\": %s\n"),wdir,strerror(errno));
                exit(EXIT_FAILURE);
        }
        write_html_header(fp_ou,0,ngettext("SARG report","SARG reports",nsort),HTML_JS_SORTTABLE);
@@ -455,7 +455,7 @@ static void make_file_index(void)
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in the index %s\n"),wdir);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close the index file %s - %s\n"),wdir,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),wdir,strerror(errno));
 
        if (sortlist) {
                for (i=0 ; i<nsort ; i++) {
@@ -540,7 +540,7 @@ static void file_index_to_date_index(const char *entry)
        ndirlen=sprintf(newdir,"%s%04d",outdir,y1);
        if (access(newdir, R_OK) != 0) {
                if (mkdir(newdir,0755)) {
-                       debuga(_("Cannot create directory %s - %s\n"),newdir,strerror(errno));
+                       debuga(_("Cannot create directory \"%s\": %s\n"),newdir,strerror(errno));
                        exit(EXIT_FAILURE);
                }
        }
@@ -548,7 +548,7 @@ static void file_index_to_date_index(const char *entry)
        else ndirlen+=sprintf(newdir+ndirlen,"/%02d",m1);
        if (access(newdir, R_OK) != 0) {
                if (mkdir(newdir,0755)) {
-                       debuga(_("Cannot create directory %s - %s\n"),newdir,strerror(errno));
+                       debuga(_("Cannot create directory \"%s\": %s\n"),newdir,strerror(errno));
                        exit(EXIT_FAILURE);
                }
        }
@@ -558,7 +558,7 @@ static void file_index_to_date_index(const char *entry)
 
        sprintf(olddir,"%s%s",outdir,entry);
        if (rename(olddir,newdir)) {
-               debuga(_("(index) rename error from \"%s\" to \"%s\" - %s\n"),olddir,newdir,strerror(errno));
+               debugapos("index",_("Error renaming \"%s\" into \"%s\": %s\n"),olddir,newdir,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -569,7 +569,7 @@ static void file_index_to_date_index(const char *entry)
 
                sprintf(linkdir,"%simages",outdir);
                if (symlink(linkdir,newdir)) {
-                       debuga(_("failed to create link \"%s\" to \"%s\" - %s\n"),linkdir,newdir,strerror(errno));
+                       debuga(_("Failed to create link \"%s\" to \"%s\": %s\n"),linkdir,newdir,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 #else
@@ -660,7 +660,7 @@ static void date_index_to_file_index(const char *entry)
                        else continue;
                        sprintf(olddir,"%s%04d/%s/%s",outdir,y1,direntp2->d_name,direntp3->d_name);
                        if(rename(olddir,newdir)) {
-                               debuga(_("(index) rename error from \"%s\" to \"%s\" - %s\n"),olddir,newdir,strerror(errno));
+                               debugapos("index",_("Error renaming \"%s\" into \"%s\": %s\n"),olddir,newdir,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                }
index 5e45643653c175a9525c70f82df830ce50f81ca4..693865fcc5ce961e28959318719efbcf8e629dc4 100644 (file)
@@ -35,7 +35,7 @@ void index_only(const char *dirname,int debug)
        char remove[MAXLEN];
 
        if ((dirp = opendir(dirname)) == NULL) {
-               debuga(_("Failed to open directory %s - %s\n"),dirname,strerror(errno));
+               debuga(_("Cannot open directory \"%s\": %s\n"),dirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
        while ( (direntp = readdir( dirp )) != NULL ){
index 5d453e62ea6e5495d7ed9d38cd3687349ae795bb..b994c91e37402e17c5b8f6812c4a9db883a211e8 100644 (file)
--- a/lastlog.c
+++ b/lastlog.c
@@ -51,12 +51,12 @@ void mklastlog(const char *outdir)
                exit(EXIT_FAILURE);
        }
        if((fp_ou=fopen(temp,"w"))==NULL) {
-               debuga(_("(lastlog) Cannot open temporary file %s\n"),temp);
+               debugapos("lastlog",_("Cannot open file \"%s\": %s\n"),temp,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if ((dirp = opendir(outdir)) == NULL) {
-               debuga(_("Failed to open directory %s - %s\n"),outdir,strerror(errno));
+               debuga(_("Cannot open directory \"%s\": %s\n"),outdir,strerror(errno));
                exit(EXIT_FAILURE);
        }
        while ((direntp = readdir( dirp )) != NULL ){
@@ -65,7 +65,7 @@ void mklastlog(const char *outdir)
 
                snprintf(warea,sizeof(warea),"%s%s",outdir,direntp->d_name);
                if (stat(warea,&statb) == -1) {
-                       debuga(_("Failed to get the creation time of %s\n"),warea);
+                       debuga(_("Failed to get the creation time of \"%s\": %s\n"),warea,strerror(errno));
                        continue;
                }
                t=statb.st_ctime;
@@ -111,7 +111,7 @@ void mklastlog(const char *outdir)
 
        snprintf(temp,sizeof(temp),"%s/lastlog",tmp);
        if((fp_in=fopen(temp,"r"))==NULL) {
-               debuga(_("(lastlog) Cannot open temporary file %s\n"),temp);
+               debugapos("lastlog",_("Cannot open file \"%s\": %s\n"),temp,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
diff --git a/log.c b/log.c
index c5d51971f2a6282281d8594d3981b89365e1604d..3d12704a09a24236cf92e1df78cda43407879a77 100644 (file)
--- a/log.c
+++ b/log.c
@@ -797,14 +797,14 @@ int main(int argc,char *argv[])
        if(DataFile[0]=='\0') {
                if((ReportType & REPORT_TYPE_DENIED) != 0) {
                        if((fp_denied=MY_FOPEN(denied_unsort,"w"))==NULL) {
-                               debuga(_("(log) Cannot open file: %s - %s\n"),denied_unsort,strerror(errno));
+                               debugapos("log",_("Cannot open file \"%s\": %s\n"),denied_unsort,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                }
 
                if((ReportType & REPORT_TYPE_DENIED) != 0 || (ReportType & REPORT_TYPE_AUTH_FAILURES) != 0) {
                        if((fp_authfail=MY_FOPEN(authfail_unsort,"w"))==NULL) {
-                               debuga(_("(log) Cannot open file: %s - %s\n"),authfail_unsort,strerror(errno));
+                               debugapos("log",_("Cannot open file \"%s\": %s\n"),authfail_unsort,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                }
@@ -824,7 +824,7 @@ int main(int argc,char *argv[])
                } else {
                        if (date[0]!='\0') {
                                if (stat(arq,&logstat)!=0) {
-                                       debuga(_("Cannot get the modification time of input log file %s (%s). Processing it anyway\n"),arq,strerror(errno));
+                                       debuga(_("Cannot get the modification time of input log file \"%s\": %s\nProcessing it anyway\n"),arq,strerror(errno));
                                } else {
                                        struct tm *logtime=localtime(&logstat.st_mtime);
                                        if ((logtime->tm_year+1900)*10000+(logtime->tm_mon+1)*100+logtime->tm_mday<dfrom) {
@@ -835,7 +835,7 @@ int main(int argc,char *argv[])
                        }
                        fp_in=decomp(arq,&from_pipe);
                        if(fp_in==NULL) {
-                               debuga(_("(log) Cannot open log file: %s - %s\n"),arq,strerror(errno));
+                               debugapos("log",_("Cannot open file \"%s\": %s\n"),arq,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                        if(debug) debuga(_("Reading access log file: %s\n"),arq);
@@ -907,7 +907,7 @@ int main(int argc,char *argv[])
                                        exit(EXIT_FAILURE);
                                }
                                if((fp_log=MY_FOPEN(arq_log,"w"))==NULL) {
-                                       debuga(_("(log) Cannot open log file: %s - %s\n"),arq_log,strerror(errno));
+                                       debugapos("log",_("Cannot open file \"%s\": %s\n"),arq_log,strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
                                fputs("*** SARG Log ***\n",fp_log);
@@ -1488,7 +1488,7 @@ int main(int argc,char *argv[])
                                                if (ufile1->file!=NULL) {
                                                        if (x>=maxopenfiles) {
                                                                if (fclose(ufile1->file)==EOF) {
-                                                                       debuga(_("Failed to close the log file of user %s - %s\n"),ufile1->user->id,strerror(errno));
+                                                                       debuga(_("Failed to close file \"%s\": %s\n"),ufile1->user->id,strerror(errno));
                                                                        exit(EXIT_FAILURE);
                                                                }
                                                                ufile1->file=NULL;
@@ -1502,7 +1502,7 @@ int main(int argc,char *argv[])
                                        exit(EXIT_FAILURE);
                                }
                                if ((ufile->file = MY_FOPEN (tmp3, "a")) == NULL) {
-                                       debuga(_("(log) Cannot open temporary file: %s - %s\n"), tmp3, strerror(errno));
+                                       debugapos("log",_("Cannot open file \"%s\": %s\n"), tmp3, strerror(errno));
                                        exit (1);
                                }
                        }
@@ -1523,7 +1523,7 @@ int main(int argc,char *argv[])
 
                                if ( ! fp_Download_Unsort ) {
                                        if ((fp_Download_Unsort = MY_FOPEN ( sz_Download_Unsort, "a")) == NULL) {
-                                               debuga(_("(log) Cannot open temporary file: %s - %s\n"),sz_Download_Unsort, strerror(errno));
+                                               debugapos("log",_("Cannot open file \"%s\": %s\n"),sz_Download_Unsort, strerror(errno));
                                                exit (1);
                                        }
                                }
@@ -1670,7 +1670,7 @@ int main(int argc,char *argv[])
                        exit(EXIT_FAILURE);
                }
                if (rename(arq_log,val4)) {
-                       debuga(_("failed to rename %s to %s - %s\n"),arq_log,val4,strerror(errno));
+                       debuga(_("Failed to rename \"%s\" into \"%s\": %s\n"),arq_log,val4,strerror(errno));
                } else {
                        strcpy(arq_log,val4);
 
@@ -1680,6 +1680,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);
                                        exit(EXIT_FAILURE);
                                }
@@ -1768,22 +1771,22 @@ static void getusers(const char *pwdfile, int debug)
                debuga(_("Loading password file from %s\n"),pwdfile);
 
        if ((fp_usr = fopen(pwdfile, "r")) == NULL) {
-               debuga(_("(getusers) Cannot open file %s - %s\n"),pwdfile,strerror(errno));
+               debugapos("getusers",_("Cannot open file \"%s\": %s\n"),pwdfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if (fseek(fp_usr, 0, SEEK_END)==-1) {
-               debuga(_("Failed to move till the end of the users file %s: %s\n"),pwdfile,strerror(errno));
+               debuga(_("Failed to move till the end of the users file \"%s\": %s\n"),pwdfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
        nreg = ftell(fp_usr);
        if (nreg<0) {
-               debuga(_("Cannot get the size of file %s\n"),pwdfile);
+               debuga(_("Cannot get the size of file \"%s\": %s\n"),pwdfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
        nreg = nreg+5000;
        if (fseek(fp_usr, 0, SEEK_SET)==-1) {
-               debuga(_("Failed to rewind the users file %s: %s\n"),pwdfile,strerror(errno));
+               debuga(_("Failed to rewind file \"%s\": %s\n"),pwdfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index 0973bc4b60e215f0b8568c6eb1322e3555131455..b517cada06ae0acd24d08fab65f7d87392a271fd 100755 (executable)
@@ -68,7 +68,7 @@ static void getlog(void)
 #endif
 
        if((fd1 == -1 ) || ((tmp = fdopen (fd1, "w+" )) == NULL)  ) {    /* failure, bail out */
-               debuga(_("(realtime) mkstemp error - %s\n"),strerror(errno));
+               debugapos("realtime",_("mkstemp error: %s\n"),strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -81,7 +81,7 @@ static void getlog(void)
        fp = popen(cmd, "r");
        if (!fp) {
                debuga(_("Failed to get the %d trailing lines of %s: %s\n"),realtime_access_log_lines,AccessLog[0],strerror(errno));
-               debuga(_("tail command: %s\n"),cmd);
+               debuga(_("Failed \"tail\" command: %s\n"),cmd);
                exit(EXIT_FAILURE);
        }
        while((buf=longline_read(fp,line)) != NULL )
@@ -214,7 +214,7 @@ static void datashow(const char *tmp)
        longline line;
 
        if((fin=fopen(tmp,"r"))==NULL) {
-               debuga(_("(realtime) open error %s - %s\n"),tmp,strerror(errno));
+               debugapos("realtime",_("Cannot open file \"%s\": %s\n"),tmp,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index f506fc94593fa550baf5cbead3c3e0b0ce6f2a2b..20af396cae50e47549e22af49e28fba556178ffc 100644 (file)
@@ -264,7 +264,7 @@ static void read_log(const char *wentp, FILE *fp_ou,int dfrom,int duntil)
        }
 
        if ((fp_in=fopen(wentp,"r"))==NULL) {
-               debuga(_("(squidguard) Cannot open log file %s\n"),wentp);
+               debugapos("squidguard",_("Cannot open file \"%s\": %s\n"),wentp,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -307,7 +307,7 @@ void redirector_log(void)
        snprintf(guard_in,sizeof(guard_in),"%s/redirector.int_unsort",tmp);
        snprintf(redirector_sorted,sizeof(redirector_sorted),"%s/redirector.int_log",tmp);
        if((fp_ou=fopen(guard_in,"a"))==NULL) {
-               debuga(_("(squidguard) Cannot open log file %s\n"),guard_in);
+               debugapos("squidguard",_("Cannot open file \"%s\": %s\n"),guard_in,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -324,7 +324,7 @@ void redirector_log(void)
                }
 
                if((fp_guard=fopen(SquidGuardConf,"r"))==NULL) {
-                       debuga(_("(squidguard) Cannot open log file %s\n"),SquidGuardConf);
+                       debugapos("squidguard",_("Cannot open file \"%s\": %s\n"),SquidGuardConf,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
@@ -452,12 +452,12 @@ void redirector_report(void)
        snprintf(report,sizeof(report),"%s/redirector.html",outdirname);
 
        if((fp_in=fopen(redirector_sorted,"r"))==NULL) {
-               debuga(_("(squidguard) Cannot open log file %s\n"),redirector_sorted);
+               debugapos("squidguard",_("Cannot open file \"%s\": %s\n"),redirector_sorted,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=fopen(report,"w"))==NULL) {
-               debuga(_("(squidguard) Cannot open log file %s\n"),report);
+               debugapos("squidguard",_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -573,7 +573,7 @@ void redirector_report(void)
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in file %s\n"),report);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),report,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
 
        if (!KeepTempLog && unlink(redirector_sorted)) {
                debuga(_("Cannot delete \"%s\": %s\n"),redirector_sorted,strerror(errno));
index 9e85aa4ad2a648ea4ef107238bfa6734e58d31b4..0df048475cccdb5bcdcf70584d940b8d81de1581 100644 (file)
--- a/repday.c
+++ b/repday.c
@@ -66,7 +66,7 @@ void report_day(const struct userinfostruct *uinfo)
        }
 
        if((fp_in=fopen(wdirname,"r"))==NULL) {
-               debuga(_("(repday) Cannot open log file %s\n"),wdirname);
+               debugapos("repday",_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -119,7 +119,7 @@ void report_day(const struct userinfostruct *uinfo)
        fclose(fp_in);
 
        if((fp_ou=fopen(arqout,"w"))==NULL) {
-               debuga(_("(repday) Cannot open log file %s\n"),arqout);
+               debugapos("repday",_("Cannot open file \"%s\": %s\n"),arqout,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -244,6 +244,6 @@ void report_day(const struct userinfostruct *uinfo)
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in file %s\n"),arqout);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),arqout,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),arqout,strerror(errno));
        return;
 }
index 66c6d60308f6f48549c175ee619742491d1e1fd8..7e703587a3f4c0d9c2eb82eab8d5a54b347095d7 100644 (file)
--- a/report.c
+++ b/report.c
@@ -97,7 +97,7 @@ void gerarel(void)
 
        snprintf(wdirname,sizeof(wdirname),"%s/sarg-general",outdirname);
        if((fp_gen=MY_FOPEN(wdirname,"w"))==NULL){
-               debuga(_("(report) Cannot open file %s\n"),wdirname);
+               debugapos("report",_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -117,11 +117,11 @@ 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)) {
-                       debuga(_("(report) directory entry too long: %s/%s.user_log\n"),tmp,uinfo->filename);
+                       debugapos("report",_("Directory entry too long: %s/%s.user_log\n"),tmp,uinfo->filename);
                        exit(EXIT_FAILURE);
                }
                if((fp_in=MY_FOPEN(tmp3,"r"))==NULL){
-                       debuga(_("(report) Cannot open file %s\n"),tmp);
+                       debugapos("report",_("Cannot open file \"%s\": %s\n"),tmp,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                user=uinfo->filename;
@@ -242,7 +242,7 @@ void gerarel(void)
                                        url_to_file(accurl,siteind,sizeof(siteind));
                                        snprintf(arqtt,sizeof(arqtt),"%s/%s/tt%s-%s.html",outdirname,uinfo->filename,uinfo->filename,siteind);
                                        if ((fp_tt = fopen(arqtt, "w")) == 0) {
-                                               debuga(_("(report) Cannot open file %s\n"),arqtt);
+                                               debugapos("report",_("Cannot open file \"%s\": %s\n"),arqtt,strerror(errno));
                                                exit(EXIT_FAILURE);
                                        }
                                        ttopen=1;
@@ -328,7 +328,7 @@ void gerarel(void)
                }
                if (fp_tmp) {
                        if (fclose(fp_tmp)==EOF)
-                               debuga(_("Failed to close temporary file for user %s - %s\n"),uinfo->filename,strerror(errno));
+                               debuga(_("Failed to close file \"%s\": %s\n"),uinfo->filename,strerror(errno));
                        fp_tmp=NULL;
                }
                if (!KeepTempLog && unlink(tmp3)) {
@@ -424,7 +424,7 @@ static FILE *maketmp(const char *user, const char *dirname, int debug)
        }
 
        if((fp_ou=fopen(wdirname,"w"))==NULL){
-               debuga(_("(report) Cannot open file %s\n"),wdirname);
+               debugapos("report",_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -465,7 +465,7 @@ static void gravaporuser(const struct userinfostruct *uinfo, const char *dirname
        }
 
        if((fp_ou=MY_FOPEN(wdirname,"a"))==NULL){
-               debuga(_("(report) Cannot open file %s\n"),wdirname);
+               debugapos("report",_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -749,7 +749,7 @@ static void grava_SmartFilter(const char *dirname, const char *user, const char
        }
 
        if((fp_ou=MY_FOPEN(wdirname,"a"))==NULL){
-               debuga(_("(report) Cannot open file %s\n"),wdirname);
+               debugapos("report",_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index c5a56d8b9758168d90a46268a5947518b61c696a..e4268f6a686484e383aadd5137c19b3425304733 100644 (file)
@@ -71,13 +71,13 @@ void siteuser(void)
        }
 
        if((fp_in=fopen(general2,"r"))==NULL) {
-               debuga(_("(siteuser) Cannot open log file %s\n"),general2);
+               debugapos("siteuser",_("Cannot open file \"%s\": %s\n"),general2,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=fopen(report,"w"))==NULL) {
-               debuga(_("(siteuser) Cannot open log file %s\n"),report);
+               debugapos("siteuser",_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -188,9 +188,9 @@ void siteuser(void)
 
        fputs("</table></div>\n",fp_ou);
        if (write_html_trailer(fp_ou)<0)
-               debuga(_("Write error in file %s\n"),report);
+               debuga(_("Write error in file \"%s\"\n"),report);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),report,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
 
        return;
 }
index 7d6e1f2cf06f80b5f94a86aeec701299146693db..cea5751ca5b73454326d4025d90595ce9ac25385 100644 (file)
@@ -81,7 +81,7 @@ void smartfilter_report(void)
                exit(EXIT_FAILURE);
        }
        if((fp_in=fopen(smart_ou,"r"))==NULL) {
-               debuga(_("(smartfilter) Cannot open log file %s\n"),smart_ou);
+               debugapos("smartfilter",_("Cannot open file \"%s\": %s\n"),smart_ou,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
@@ -91,7 +91,7 @@ void smartfilter_report(void)
        }
 
        if((fp_ou=fopen(report,"w"))==NULL) {
-               debuga(_("(smartfilter) Cannot open log file %s\n"),report);
+               debugapos("smartfilter",_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -143,7 +143,7 @@ void smartfilter_report(void)
                                fclose(fp_user);
                        }
                        if ((fp_user = fopen(smartuser, "a")) == 0) {
-                               debuga(_("(smartfilter) Cannot open file %s\n"),smartuser);
+                               debugapos("smartfilter",_("Cannot open file \"%s\": %s\n"),smartuser,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                        fuser=1;
index c92913a043c71fda36c7fde658aca97047b680c8..e1cfd33b812a3278cec09783520ffa91a2fb5e6d 100644 (file)
@@ -67,7 +67,7 @@ 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) {
-                       debuga(_("(splitlog) Output path is too long: %s%s-YYYY-mm-dd\n"),outdir,splitprefix);
+                       debugapos("splitlog",_("Output path is too long: %s%s-YYYY-mm-dd\n"),outdir,splitprefix);
                        exit(EXIT_FAILURE);
                }
                autosplit=1;
@@ -81,7 +81,7 @@ void splitlog(const char *arq, const char *df, int dfrom, int duntil, int conver
        if (arq[0]=='-' && arq[1]=='\0') {
                fp_in=stdin;
        } else if((fp_in=MY_FOPEN(arq,"r"))==NULL) {
-               debuga(_("(splitlog) Cannot open log file %s - %s\n"),arq,strerror(errno));
+               debugapos("splitlog",_("Cannot open file \"%s\": %s\n"),arq,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -111,7 +111,7 @@ void splitlog(const char *arq, const char *df, int dfrom, int duntil, int conver
                        prev_month=t->tm_mon;
                        prev_day=t->tm_mday;
                        if (fp_ou && fclose(fp_ou)==EOF) {
-                               debuga(_("Failed to close file %s - %s\n"),output_file,strerror(errno));
+                               debuga(_("Failed to close file \"%s\": %s\n"),output_file,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                        strftime(output_file+output_prefix_len, sizeof(output_file)-output_prefix_len, "-%Y-%m-%d", t);
@@ -121,7 +121,7 @@ void splitlog(const char *arq, const char *df, int dfrom, int duntil, int conver
                        a second time.
                        */
                        if ((fp_ou=MY_FOPEN(output_file,(tt>=min_tt && tt<=max_tt) ? "a" : "w"))==NULL) {
-                               debuga(_("(splitlog) Cannot open output log file %s - %s\n"),output_file,strerror(errno));
+                               debugapos("splitlog",_("Cannot open file \"%s\": %s\n"),output_file,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                        if (tt<min_tt) min_tt=tt;
@@ -142,11 +142,11 @@ void splitlog(const char *arq, const char *df, int dfrom, int duntil, int conver
 
        longline_destroy(&line);
        if (fp_in!=stdin && fclose(fp_in)==EOF) {
-               debuga(_("Failed to close file %s - %s\n"),arq,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),arq,strerror(errno));
        }
        if (autosplit && fp_ou) {
                if (fclose(fp_ou)==EOF) {
-                       debuga(_("Failed to close file %s - %s\n"),output_file,strerror(errno));
+                       debuga(_("Failed to close file \"%s\": %s\n"),output_file,strerror(errno));
                        exit(EXIT_FAILURE);
                }
        }
index ad962b6852fba73f9dd0b33dbd099340c62db8ce..de53468247aa2a9548a578ce8dda87c43e83b322 100644 (file)
@@ -92,13 +92,13 @@ void topsites(void)
        }
 
        if((fp_in=fopen(general2,"r"))==NULL) {
-               debuga(_("(topsites) Cannot open log file %s\n"),general2);
+               debugapos("topsites",_("Cannot open file \"%s\": %s\n"),general2,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=fopen(general3,"w"))==NULL) {
-               debuga(_("(topsites) Cannot open log file %s\n"),general3);
+               debugapos("topsites",_("Cannot open file \"%s\": %s\n"),general3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -214,7 +214,7 @@ void topsites(void)
                exit(EXIT_FAILURE);
        }
        if((fp_in=fopen(sites,"r"))==NULL) {
-               debuga(_("(topsites) Cannot open log file %s\n"),sites);
+               debugapos("topsites",_("Cannot open file \"%s\": %s\n"),sites,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
@@ -225,7 +225,7 @@ void topsites(void)
        }
 
        if((fp_ou=fopen(report,"w"))==NULL) {
-               debuga(_("(topsites) Cannot open log file %s\n"),report);
+               debugapos("topsites",_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -318,7 +318,7 @@ void topsites(void)
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in file %s\n"),report);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),report,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno));
 
        return;
 }
index bc705a4ef0f7a228718619b04f13071038c2edab..977c3b17c008838e12f9d42498ea97c59fe9ffa5 100644 (file)
--- a/topuser.c
+++ b/topuser.c
@@ -42,12 +42,12 @@ static void set_total_users(int totuser)
        
        snprintf(tusr,sizeof(tusr),"%s/sarg-users",outdirname);
        if((fp_ou=fopen(tusr,"w"))==NULL) {
-               debuga(_("(topuser) Cannot open file %s\n"),tusr);
+               debugapos("topuser",_("Cannot open file \"%s\": %s\n"),tusr,strerror(errno));
                exit(EXIT_FAILURE);
        }
        fprintf(fp_ou,"%d\n",totuser);
        if (fclose(fp_ou)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),tusr,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),tusr,strerror(errno));
        globstat.totuser=totuser;
 }
 
@@ -84,13 +84,13 @@ void topuser(void)
        ntopuser = 0;
        snprintf(wger,sizeof(wger),"%s/sarg-general",outdirname);
        if((fp_in=fopen(wger,"r"))==NULL) {
-               debuga(_("(topuser) Cannot open file %s\n"),wger);
+               debugapos("topuser",_("Cannot open file \"%s\": %s\n"),wger,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        snprintf(top2,sizeof(top2),"%s/top.tmp",outdirname);
        if((fp_top2=fopen(top2,"w"))==NULL) {
-               debuga(_("(topuser) Cannot open file %s\n"),top2);
+               debugapos("topuser",_("Cannot open file \"%s\": %s\n"),top2,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -197,7 +197,7 @@ void topuser(void)
        }
 
        if((fp_top1=fopen(top1,"r"))==NULL) {
-               debuga(_("(topuser) Cannot open file %s\n"),top1);
+               debugapos("topuser",_("Cannot open file \"%s\": %s\n"),top1,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -208,7 +208,7 @@ void topuser(void)
 
        snprintf(top3,sizeof(top3),"%s/index.html",outdirname);
        if((fp_top3=fopen(top3,"w"))==NULL) {
-               debuga(_("(topuser) Cannot open file %s\n"),top3);
+               debugapos("topuser",_("Cannot open file \"%s\": %s\n"),top3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -480,7 +480,7 @@ void topuser(void)
        if (write_html_trailer(fp_top3)<0)
                debuga(_("Write error in top user list %s\n"),top3);
        if (fclose(fp_top3)==EOF)
-               debuga(_("Failed to close the top user list %s - %s\n"),top3,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),top3,strerror(errno));
 
        return;
 }
index 9465ffd5e10e43e257f9da04d9e66a57d9a912fb..2bf80ce5c348a4725f981efead01a382031f7eda 100644 (file)
--- a/totday.c
+++ b/totday.c
@@ -155,7 +155,7 @@ void day_totalize(DayObject ddata,const char *tmp, const struct userinfostruct *
        }
 
        if((fp_ou=fopen(arqout,"w"))==NULL) {
-               debuga(_("(totday) Cannot open log file %s\n"),arqout);
+               debugapos("totday",_("Cannot open file \"%s\": %s\n"),arqout,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -178,7 +178,7 @@ void day_totalize(DayObject ddata,const char *tmp, const struct userinfostruct *
        }
 
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Failed to close file %s - %s\n"),arqout,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),arqout,strerror(errno));
                exit(EXIT_FAILURE);
        }
        return;
index fafdd9c05665c217d5e5a71c3a85f4c143b93055..4553c20feb3814d173e72008a648d3fd791e9709 100644 (file)
@@ -62,12 +62,12 @@ void useragent(void)
        sprintf(tmp2,"%s/squagent.int_log",tmp);
 
        if((fp_in=fopen(UserAgentLog,"r"))==NULL) {
-               debuga(_("(useragent) Cannot open file %s\n"),UserAgentLog);
+               debugapos("useragent",_("Cannot open file \"%s\": %s\n"),UserAgentLog,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=fopen(tmp3,"w"))==NULL) {
-               debuga(_("(useragent) Cannot open file %s\n"),tmp3);
+               debugapos("useragent",_("Cannot open file \"%s\": %s\n"),tmp3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -124,7 +124,7 @@ void useragent(void)
 
        fclose(fp_in);
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Failed to close file %s - %s\n"),tmp3,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),tmp3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -143,7 +143,7 @@ void useragent(void)
                exit(EXIT_FAILURE);
        }
        if((fp_in=fopen(tmp2,"r"))==NULL) {
-               debuga(_("(useragent) Cannot open file %s\n"),tmp2);
+               debugapos("useragent",_("Cannot open file \"%s\": %s\n"),tmp2,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
@@ -155,7 +155,7 @@ void useragent(void)
 
        snprintf(hfile,sizeof(hfile),"%s/useragent.html", outdirname);
        if((fp_ht=fopen(hfile,"w"))==NULL) {
-               debuga(_("(useragent) Cannot open file %s\n"),hfile);
+               debugapos("useragent",_("Cannot open file \"%s\": %s\n"),hfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -226,7 +226,7 @@ void useragent(void)
                exit(EXIT_FAILURE);
        }
        if((fp_in=fopen(tmp3,"r"))==NULL) {
-               debuga(_("(useragent) Cannot open file %s\n"),tmp3);
+               debugapos("useragent",_("Cannot open file \"%s\": %s\n"),tmp3,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
@@ -237,7 +237,7 @@ void useragent(void)
        }
 
        if((fp_ou=fopen(tmp2,"w"))==NULL) {
-               debuga(_("(useragent) Cannot open file %s\n"),tmp2);
+               debugapos("useragent",_("Cannot open file \"%s\": %s\n"),tmp2,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -275,7 +275,7 @@ void useragent(void)
 
        fclose(fp_in);
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Failed to close file %s - %s\n"),tmp3,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),tmp3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -295,7 +295,7 @@ void useragent(void)
                exit(EXIT_FAILURE);
        }
        if((fp_in=fopen(tmp3,"r"))==NULL) {
-               debuga(_("(useragent) Cannot open file %s\n"),tmp3);
+               debugapos("useragent",_("Cannot open file \"%s\": %s\n"),tmp3,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
@@ -331,7 +331,7 @@ void useragent(void)
        if (write_html_trailer(fp_ht)<0)
                debuga(_("Write error in file %s\n"),hfile);
        if (fclose(fp_ht)==EOF)
-               debuga(_("Failed to close file %s - %s\n"),hfile,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),hfile,strerror(errno));
 
        if (!KeepTempLog && unlink(tmp3)) {
                debuga(_("Cannot delete \"%s\": %s\n"),tmp3,strerror(errno));
index 3f970cdb3c5b0277123da40867e54a2c833d2cc6..8f9258f77cb9a65259cddc9992ea7b6e4b9d4385 100644 (file)
--- a/usertab.c
+++ b/usertab.c
@@ -61,7 +61,7 @@ static void init_file_usertab(const char *UserTabFile)
        int z1, z2;
 
        if((fp_usr=fopen(UserTabFile,"r"))==NULL) {
-               debuga(_("(usertab) Cannot open file %s - %s\n"),UserTabFile,strerror(errno));
+               debugapos("usertab",_("Cannot open file \"%s\": %s\n"),UserTabFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
        if (fseek(fp_usr, 0, SEEK_END)==-1) {
@@ -70,16 +70,16 @@ static void init_file_usertab(const char *UserTabFile)
        }
        nreg = ftell(fp_usr);
        if (nreg<0) {
-               debuga(_("Cannot get the size of file %s\n"),UserTabFile);
+               debuga(_("Cannot get the size of file \"%s\": %s\n"),UserTabFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
        nreg += 100;
        if (fseek(fp_usr, 0, SEEK_SET)==-1) {
-               debuga(_("Failed to rewind the usertab file %s: %s\n"),UserTabFile,strerror(errno));
+               debuga(_("Failed to rewind file \"%s\": %s\n"),UserTabFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
        if((userfile=(char *) malloc(nreg))==NULL){
-               debuga(_("ERROR: Cannot load. Memory fault\n"));
+               debuga(_("Cannot load \"%s\": not enough memory\n"),UserTabFile);
                exit(EXIT_FAILURE);
        }
        userfile[0]='\t';
@@ -263,7 +263,7 @@ void init_usertab(const char *UserTabFile)
 {
        if (strcmp(UserTabFile, "ldap") == 0) {
                if(debug)
-                       debuga(_("Loading User table: %s\n"),UserTabFile);
+                       debuga(_("Loading user table from LDAP\n"));
 #ifdef HAVE_LDAP_H
                which_usertab=UTT_Ldap;
                init_ldap_usertab();
diff --git a/util.c b/util.c
index 4b74ad43259a977d1dcfdd988c372774523055c6..8aec7aba7cab8b8a156682f93a3d19fb85a66dc8 100644 (file)
--- a/util.c
+++ b/util.c
@@ -54,6 +54,9 @@ static void getword_backtrace(void)
        if (n<=0) return;
        calls=backtrace_symbols(buffer,n);
        if (calls) {
+               /* TRANSLATORS: "getword" is the function displaying
+                * the backtrace leading to its execution.
+                */
                debuga(_("getword backtrace:\n"));
                for (i=0 ; i<n ; i++) {
                        fprintf(stderr,"SARG: %d:%s\n",i+1,calls[i]);
@@ -85,7 +88,9 @@ int getword(char *word, int limit, struct getwordstruct *gwarea, char stop)
 
        for(x=0;((gwarea->current[x]) && (gwarea->current[x] != stop ));x++) {
                if(x>=limit) {
-                       debuga(_("getword loop detected after %d bytes.\n"),x);
+                       /* TRANSLATORS: %s is the name of the function reporting this error.
+                        */
+                       debuga(_("Loop detected in %s after %d bytes.\n"),__func__,x);
                        debuga(_("Line=\"%s\"\n"),gwarea->beginning);
                        debuga(_("Record=\"%s\"\n"),gwarea->current);
                        debuga(_("searching for \'x%x\'\n"),stop);
@@ -126,7 +131,9 @@ int getword_multisep(char *word, int limit, struct getwordstruct *gwarea, char s
 
        for(x=0;((gwarea->current[x]) && (gwarea->current[x] != stop ));x++) {
                if(x>=limit) {
-                       debuga(_("getword_multisep loop detected.\n"));
+                       /* TRANSLATORS: %s is the name of the function reporting this error.
+                        */
+                       debuga(_("Loop detected in %s after %d bytes.\n"),__func__,x);
                        debuga(_("Line=\"%s\"\n"),gwarea->beginning);
                        debuga(_("Record=\"%s\"\n"),gwarea->current);
                        debuga(_("searching for \'x%x\'\n"),stop);
@@ -153,7 +160,9 @@ int getword_skip(int limit, struct getwordstruct *gwarea, char stop)
 
        for(x=0;(gwarea->current[x] && (gwarea->current[x] != stop ));x++) {
                if(x>=limit) {
-                       debuga(_("getword_skip loop detected after %d bytes.\n"),x);
+                       /* TRANSLATORS: %s is the name of the function reporting this error.
+                        */
+                       debuga(_("Loop detected in %s after %d bytes.\n"),__func__,x);
                        debuga(_("Line=\"%s\"\n"),gwarea->beginning);
                        debuga(_("Record=\"%s\"\n"),gwarea->current);
                        debuga(_("searching for \'x%x\'\n"),stop);
@@ -186,13 +195,18 @@ int getword_atoll(long long int *number, struct getwordstruct *gwarea, char stop
        for(x=0;isdigit(gwarea->current[x]);x++) {
                digit=gwarea->current[x]-'0';
                if (*number >= (LLONG_MAX-digit)/10) {
-                       debuga(_("Integer overflow detected in getword_atoll in line %s\n"),gwarea->beginning);
+                       /* TRANSLATORS: The first %s is the name of the function displaying
+                        * this message.
+                        */
+                       debuga(_("Integer overflow detected in %s in line \"%s\"\n"),__func__,gwarea->beginning);
                        return(-1);
                }
                *number=(*number * 10) + digit;
        }
        if(gwarea->current[x] && gwarea->current[x]!=stop) {
-               debuga(_("getword_atoll loop detected after %d bytes.\n"),x);
+               /* TRANSLATORS: %s is the name of the function reporting this error.
+                */
+               debuga(_("Loop detected in %s after %d bytes.\n"),__func__,x);
                debuga(_("Line=\"%s\"\n"),gwarea->beginning);
                debuga(_("Record=\"%s\"\n"),gwarea->current);
                debuga(_("searching for \'x%x\'\n"),stop);
@@ -225,13 +239,18 @@ int getword_atoi(int *number, struct getwordstruct *gwarea, char stop)
        for(x=0;isdigit(gwarea->current[x]);x++) {
                digit=gwarea->current[x]-'0';
                if (*number > (INT_MAX-digit)/10) {
-                       debuga(_("Integer overflow detected in getword_atoi in line %s\n"),gwarea->beginning);
+                       /* TRANSLATORS: The first %s is the name of the function displaying
+                        * this message.
+                        */
+                       debuga(_("Integer overflow detected in %s in line \"%s\"\n"),__func__,gwarea->beginning);
                        return(-1);
                }
                *number=(*number * 10) + digit;
        }
        if(gwarea->current[x] && gwarea->current[x]!=stop) {
-               debuga(_("getword_atoi loop detected after %d bytes.\n"),x);
+               /* TRANSLATORS: %s is the name of the function reporting this error.
+                */
+               debuga(_("Loop detected in %s after %d bytes.\n"),__func__,x);
                debuga(_("Line=\"%s\"\n"),gwarea->beginning);
                debuga(_("Record=\"%s\"\n"),gwarea->current);
                debuga(_("searching for \'x%x\'\n"),stop);
@@ -316,7 +335,7 @@ void my_mkdir(const char *name)
        int chars;
 
        if(!is_absolute(name)) {
-               debuga(_("Invalid path (%s). Please, use absolute paths only.\n"),name);
+               debuga(_("Invalid path \"%s\". Please, use absolute paths only.\n"),name);
                exit(EXIT_FAILURE);
        }
 
@@ -330,7 +349,7 @@ void my_mkdir(const char *name)
                        w0[i] = '\0';
                        if (access(w0, R_OK) != 0) {
                                if (mkdir(w0,0755)) {
-                                       debuga(_("Cannot create directory %s - %s\n"),w0,strerror(errno));
+                                       debuga(_("Cannot create directory \"%s\": %s\n"),w0,strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
                        }
@@ -341,7 +360,7 @@ void my_mkdir(const char *name)
 
        if (access(name, R_OK) != 0) {
                if (mkdir(name,0755)) {
-                       debuga(_("Cannot create directory %s - %s\n"),name,strerror(errno));
+                       debuga(_("Cannot create directory \"%s\": %s\n"),name,strerror(errno));
                        exit(EXIT_FAILURE);
                }
        }
@@ -463,6 +482,23 @@ void debuga(const char *msg,...)
        va_end(ap);
 }
 
+/*!
+Write a debug message to stderr. The message is prefixed by "SARG:" to identify its origin.
+
+\param pos Where, in the source code, this message comes from.
+\param msg The printf like message to format.
+\param ... The arguments to format in the message.
+*/
+void debugapos(const char *pos,const char *msg,...)
+{
+       va_list ap;
+
+       fputs(_("SARG: "),stderr);
+       fprintf(stderr,"(%s) ",pos);
+       va_start(ap,msg);
+       vfprintf(stderr,msg,ap);
+       va_end(ap);
+}
 
 /*!
 Write a debug message to stderr. The message is prefixed by "SARG: (info)".
@@ -659,7 +695,9 @@ int obtdate(const char *dirname, const char *name, char *data)
        }
 
        if (!fgets(data,80,fp_in)) {
-               debuga(_("Failed to read the date in %s\n"),wdir);
+               /* TRANSLATORS: %s is a file name.
+                */
+               debuga(_("Failed to read the date in \"%s\"\n"),wdir);
                exit(EXIT_FAILURE);
        }
        fclose(fp_in);
@@ -715,7 +753,9 @@ int obtuser(const char *dirname, const char *name)
        }
 
        if (!fgets(tuser,sizeof(tuser),fp_in)) {
-               debuga(_("Failed to read the number of users in %s\n"),wdir);
+               /* TRANSLATORS: %s is a file name.
+                */
+               debuga(_("Failed to read the number of users in \"%s\"\n"),wdir);
                exit(EXIT_FAILURE);
        }
        fclose(fp_in);
@@ -747,7 +787,9 @@ void obttotal(const char *dirname, const char *name, int nuser, long long int *t
        }
 
        if ((line=longline_create())==NULL) {
-               debuga(_("Not enough memory to read the file %s\n"),wdir);
+               /* TRANSLATORS: %s is a file name.
+                */
+               debuga(_("Not enough memory to read \"%s\"\n"),wdir);
                exit(EXIT_FAILURE);
        }
 
@@ -760,17 +802,17 @@ void obttotal(const char *dirname, const char *name, int nuser, long long int *t
                        continue;
                getword_start(&gwarea,buf);
                if (getword(user,sizeof(user),&gwarea,sep)<0) {
-                       debuga(_("There is a invalid user in file %s\n"),wdir);
+                       debuga(_("There is an invalid user in file \"%s\"\n"),wdir);
                        exit(EXIT_FAILURE);
                }
                if(strcmp(user,"TOTAL") != 0)
                        continue;
                if (getword_skip(MAXLEN,&gwarea,sep)<0) {
-                       debuga(_("There a broken total number of access in file %s\n"),wdir);
+                       debuga(_("There a broken total number of access in file \"%s\"\n"),wdir);
                        exit(EXIT_FAILURE);
                }
                if (getword_atoll(tbytes,&gwarea,sep)<0) {
-                       debuga(_("There is a broken number of bytes in file %s\n"),wdir);
+                       debuga(_("There is a broken number of bytes in file \"%s\"\n"),wdir);
                        exit(EXIT_FAILURE);
                }
                break;
@@ -925,12 +967,12 @@ static void copy_images(void)
        struct stat info;
 
        if (snprintf(images,sizeof(images),"%simages",outdir)>=sizeof(images)) {
-               debuga(_("Cannot copy images to target directory %simages\n"),outdir);
+               debuga(_("Resulting target directory too long: %simages\n"),outdir);
                exit(EXIT_FAILURE);
        }
        if (access(images,R_OK)!=0) {
                if (mkdir(images,0755)) {
-                       debuga(_("Cannot create directory %s - %s\n"),images,strerror(errno));
+                       debuga(_("Cannot create directory \"%s\": %s\n"),images,strerror(errno));
                        exit(EXIT_FAILURE);
                }
        }
@@ -938,7 +980,7 @@ static void copy_images(void)
        strcpy(imgdir,IMAGEDIR);
        dirp = opendir(imgdir);
        if(dirp==NULL) {
-               debuga(_("(util) Can't open directory %s: %s\n"),imgdir,strerror(errno));
+               debugapos("util",_("Cannot open directory \"%s\": %s\n"),imgdir,strerror(errno));
                return;
        }
        while ((direntp = readdir( dirp )) != NULL ){
@@ -946,7 +988,7 @@ static void copy_images(void)
                        continue;
                sprintf(srcfile,"%s/%s",imgdir,direntp->d_name);
                if (stat(srcfile,&info)) {
-                       debuga(_("Cannot stat \"%s\" - %s\n"),srcfile,strerror(errno));
+                       debuga(_("Cannot stat \"%s\": %s\n"),srcfile,strerror(errno));
                        continue;
                }
                if (S_ISREG(info.st_mode)) {
@@ -957,16 +999,16 @@ static void copy_images(void)
                                if(img_ou!=NULL) {
                                        while ((nread = fread(buffer,1,sizeof(buffer),img_in))>0) {
                                                if (fwrite(buffer,1,nread,img_ou)!=nread) {
-                                                       debuga(_("Failed to copy image %s to %s\n"),srcfile,dstfile);
+                                                       debuga(_("Failed to copy image \"%s\" to \"%s\"\n"),srcfile,dstfile);
                                                        break;
                                                }
                                        }
                                        fclose(img_ou);
                                } else
-                                       fprintf(stderr,"SARG: (util): %s %s: %s\n", _("Cannot open file")?_("Cannot open file"):"Can't open/create file", dstfile, strerror(errno));
+                                       debugapos("util",_("Cannot open file \"%s\": %s\n"), dstfile, strerror(errno));
                                fclose(img_in);
                        } else
-                               fprintf(stderr,"SARG: (util): %s %s: %s\n", _("Cannot open file")?_("Cannot open file"):"Can't open file", srcfile, strerror(errno));
+                               debugapos("util",_("Cannot open file \"%s\": %s\n"),srcfile, strerror(errno));
                }
        }
        (void) closedir(dirp);
@@ -1053,7 +1095,7 @@ int vrfydir(const struct periodstruct *per1, const char *addr, const char *site,
 
                        if(count > 0) {
                                if(debug)
-                                       debuga(_("File %s already exists, moved to %s\n"),outdirname,wdir);
+                                       debuga(_("File \"%s\" already exists, moved to \"%s\"\n"),outdirname,wdir);
                                rename(outdirname,wdir);
                        }
                } else {
@@ -1076,7 +1118,7 @@ int vrfydir(const struct periodstruct *per1, const char *addr, const char *site,
 
                        if(count > 0) {
                                if(debug)
-                                       debuga(_("File %s already exists, moved to %s\n"),dirname2,wdir);
+                                       debuga(_("File \"%s\" already exists, moved to \"%s\"\n"),dirname2,wdir);
                                rename(dirname2,wdir);
                                strcpy(dirname2,wdir);
                        }
@@ -1094,7 +1136,7 @@ int vrfydir(const struct periodstruct *per1, const char *addr, const char *site,
 
        sprintf(wdir,"%s/sarg-date",outdirname);
        if ((fp_ou = fopen(wdir, "wt")) == 0) {
-               debuga(_("cannot open %s for writing\n"),wdir);
+               debuga(_("Cannot open \"%s\": %s\n"),wdir,strerror(errno));
                perror("SARG:");
                exit(EXIT_FAILURE);
        }
@@ -1103,12 +1145,12 @@ int vrfydir(const struct periodstruct *per1, const char *addr, const char *site,
        loctm=localtime(&curtime);
        strftime(wdir,sizeof(wdir),"%Y-%m-%d %H:%M:%S",loctm);
        if (fprintf(fp_ou,"%s %d\n",wdir,loctm->tm_isdst)<0) {
-               debuga(_("Failed to write the date in %s\n"),wdir);
+               debuga(_("Failed to write the date in \"%s\"\n"),wdir);
                perror("SARG:");
                exit(EXIT_FAILURE);
        }
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Failed to write the date in %s\n"),wdir);
+               debuga(_("Failed to write the date in \"%s\": %s\n"),wdir,strerror(errno));
                perror("SARG:");
                exit(EXIT_FAILURE);
        }
@@ -1377,16 +1419,16 @@ 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);
+               debugapos("removetmp",_("Directory too long: %s/sarg-period\n"),outdir);
                exit(EXIT_FAILURE);
        }
        if((fp_gen=fopen(filename,"w"))==NULL){
-               debuga(_("(removetmp) Cannot open file %s\n"),filename);
+               debugapos("removetmp",_("Cannot open file \"%s\": %s\n"),filename,strerror(errno));
                exit(EXIT_FAILURE);
        }
        totalger(fp_gen,filename);
        if (fclose(fp_gen)==EOF) {
-               debuga(_("Failed to close %s after writing the total line - %s\n"),filename,strerror(errno));
+               debuga(_("Failed to close file \"%s\": %s\n"),filename,strerror(errno));
                exit(EXIT_FAILURE);
        }
 }
@@ -1403,27 +1445,27 @@ void load_excludecodes(const char *ExcludeCodes)
                return;
 
        if((fp_in=fopen(ExcludeCodes,"r"))==NULL) {
-               debuga(_("(util) Cannot open file %s (exclude_codes)\n"),ExcludeCodes);
+               debugapos("util",_("Cannot open file \"%s\": %s\n"),ExcludeCodes,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if (fseek(fp_in, 0, SEEK_END)==-1) {
-               debuga(_("Failed to move till the end of the excluded codes file %s: %s\n"),ExcludeCodes,strerror(errno));
+               debuga(_("Failed to move till the end of the excluded codes file \"%s\": %s\n"),ExcludeCodes,strerror(errno));
                exit(EXIT_FAILURE);
        }
        MemSize = ftell(fp_in);
        if (MemSize<0) {
-               debuga(_("Cannot get the size of file %s\n"),ExcludeCodes);
+               debuga(_("Cannot get the size of file \"%s\": %s\n"),ExcludeCodes,strerror(errno));
                exit(EXIT_FAILURE);
        }
        if (fseek(fp_in, 0, SEEK_SET)==-1) {
-               debuga(_("Failed to rewind the excluded codes file %s: %s\n"),ExcludeCodes,strerror(errno));
+               debuga(_("Failed to rewind file \"%s\": %s\n"),ExcludeCodes,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        MemSize+=1;
        if((excludecode=(char *) malloc(MemSize))==NULL) {
-               debuga(_("malloc error (%ld)\n"),MemSize);
+               debuga(_("malloc failed to allocate %ld bytes\n"),MemSize);
                exit(EXIT_FAILURE);
        }
        memset(excludecode,0,MemSize);
@@ -1434,7 +1476,7 @@ void load_excludecodes(const char *ExcludeCodes)
                for (i=strlen(data)-1 ; i>=0 && (unsigned char)data[i]<=' ' ; i--) data[i]='\0';
                if (i<0) continue;
                if (Stored+i+2>=MemSize) {
-                       debuga(_("Too many codes to exclude in file %s\n"),ExcludeCodes);
+                       debuga(_("Too many codes to exclude in file \"%s\"\n"),ExcludeCodes);
                        break;
                }
                strcat(excludecode,data);
@@ -1587,8 +1629,8 @@ char *get_size(const char *path, const char *file)
        char cmd[255];
        char *ptr;
 
-       if (snprintf(cmd,sizeof(cmd),"du -skh %s%s",path,file)>=sizeof(cmd)) {
-               debuga(_("Cannot get disk space because the path %s%s is too long\n"),path,file);
+       if (snprintf(cmd,sizeof(cmd),"du -skh \"%s%s\"",path,file)>=sizeof(cmd)) {
+               debuga(_("Cannot get disk space because the path \"%s%s\" is too long\n"),path,file);
                exit(EXIT_FAILURE);
        }
        if ((fp = popen(cmd, "r")) == NULL) {
@@ -1601,7 +1643,10 @@ char *get_size(const char *path, const char *file)
        }
        ptr=strchr(response,'\t');
        if (ptr==NULL) {
-               debuga(_("The command %s failed\n"),cmd);
+               /* TRANSLATORS: First %s is the command to get the occuped disk size (namely, du -skh "...").
+                * The second %s is the string returned by the command.
+                */
+               debuga(_("The command to compute the occupied disk size (%s) returned the unknown string %s\n"),cmd,response);
                exit(EXIT_FAILURE);
        }
        pclose(fp);
@@ -1830,7 +1875,7 @@ 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(_("Directory name to delete too long: %s/%s\n"),dir,direntp->d_name);
                        exit(EXIT_FAILURE);
                }
 #ifdef HAVE_LSTAT
@@ -1839,7 +1884,7 @@ void unlinkdir(const char *dir,bool contentonly)
                err=stat(dname,&st);
 #endif
                if (err) {
-                       debuga(_("cannot stat %s\n"),dname);
+                       debuga(_("Cannot stat \"%s\": %s\n"),dname,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                if (S_ISREG(st.st_mode)) {
@@ -1850,7 +1895,7 @@ void unlinkdir(const char *dir,bool contentonly)
                } else if (S_ISDIR(st.st_mode)) {
                        unlinkdir(dname,0);
                } else {
-                       debuga(_("unknown path type %s\n"),dname);
+                       debuga(_("Unknown path type \"%s\"\n"),dname);
                }
        }
        closedir(dirp);
@@ -1921,7 +1966,7 @@ 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(_("Directory name to delete too long: %s/%s\n"),dir,direntp->d_name);
                        exit(EXIT_FAILURE);
                }
                
@@ -1931,7 +1976,7 @@ void emptytmpdir(const char *dir)
                err=stat(dname,&st);
 #endif
                if (err) {
-                       debuga(_("cannot stat \"%s\"\n"),dname);
+                       debuga(_("Cannot stat \"%s\": %s\n"),dname,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                if (S_ISDIR(st.st_mode)) {
@@ -1963,7 +2008,7 @@ 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(_("Directory name to delete too long: %s/%s\n"),dir,direntp->d_name);
                        exit(EXIT_FAILURE);
                }
 #ifdef HAVE_LSTAT
@@ -1972,7 +2017,7 @@ void emptytmpdir(const char *dir)
                err=stat(dname,&st);
 #endif
                if (err) {
-                       debuga(_("cannot stat \"%s\"\n"),dname);
+                       debuga(_("Cannot stat \"%s\": %s\n"),dname,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                if (S_ISREG(st.st_mode)) {
@@ -1981,7 +2026,7 @@ void emptytmpdir(const char *dir)
                                exit(EXIT_FAILURE);
                        }
                } else {
-                       debuga(_("unknown path type %s\n"),dname);
+                       debuga(_("Unknown path type \"%s\"\n"),dname);
                }
        }
        closedir(dirp);