]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Normalize the messages to have less messages to translate.
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 2 Apr 2015 19:08:06 +0000 (21:08 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 2 Apr 2015 19:08:06 +0000 (21:08 +0200)
32 files changed:
auth.c
authfail.c
convlog.c
dansguardian_log.c
dansguardian_report.c
datafile.c
decomp.c
denied.c
download.c
email.c
exclude.c
getconf.c
grepday.c
html.c
index.c
log.c
readlog.c
realtime.c
redirector.c
repday.c
report.c
siteuser.c
smartfilter.c
splitlog.c
topsites.c
topuser.c
totday.c
url.c
useragent.c
userinfo.c
usertab.c
util.c

diff --git a/auth.c b/auth.c
index 57d352e182e46ed0c8f469ecab309a8717d35f21..bf54d619f3eab7c4b5a7feaf753a6adeb814c6da 100644 (file)
--- a/auth.c
+++ b/auth.c
@@ -44,12 +44,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));
+               debuga(_("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));
+               debuga(_("Cannot open file \"%s\": %s\n"),AuthUserTemplateFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -63,7 +63,7 @@ void htaccess(const struct userinfostruct *uinfo)
                        }
        }
        if (fclose(fp_auth)==EOF) {
-               debuga(_("Write error in %s: %s\n"),htname,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),htname,strerror(errno));
                exit(EXIT_FAILURE);
        }
        fclose(fp_in);
index e3f62a6a7d229689abc28308b3785e49c3272938..a7dc5a57a5255c960ba9686812a1c1567ea4a4d5 100644 (file)
@@ -53,7 +53,7 @@ void authfail_open(void)
 
        snprintf(authfail_unsort,sizeof(authfail_unsort),"%s/authfail.int_unsort",tmp);
        if ((fp_authfail=MY_FOPEN(authfail_unsort,"w"))==NULL) {
-               debuga(_("(log) Cannot open file %s: %s\n"),authfail_unsort,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),authfail_unsort,strerror(errno));
                exit(EXIT_FAILURE);
        }
        return;
@@ -83,7 +83,7 @@ void authfail_close(void)
        if (fp_authfail)
        {
                if (fclose(fp_authfail)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),authfail_unsort,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),authfail_unsort,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                fp_authfail=NULL;
@@ -158,7 +158,7 @@ void authfail_report(void)
                exit(EXIT_FAILURE);
        }
        if((fp_in=MY_FOPEN(authfail_sort,"r"))==NULL) {
-               debuga(_("(authfail) Cannot open file %s: %s\n"),authfail_sort,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),authfail_sort,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
@@ -169,7 +169,7 @@ void authfail_report(void)
        authfail_unsort[0]='\0';
 
        if((fp_ou=MY_FOPEN(report,"w"))==NULL) {
-               debuga(_("(authfail) Cannot open file %s: %s\n"),report,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -274,12 +274,12 @@ 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(_("Write error in %s: %s\n"),report,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if (!KeepTempLog && unlink(authfail_sort)) {
-               debuga(_("Cannot delete %s - %s\n"),authfail_sort,strerror(errno));
+               debuga(_("Cannot delete \"%s\": %s\n"),authfail_sort,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -293,7 +293,7 @@ void authfail_cleanup(void)
 {
        if (fp_authfail) {
                if (fclose(fp_authfail)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),authfail_unsort,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),authfail_unsort,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                fp_authfail=NULL;
index 3c22413be179a3093b05fd5185b5bc74283f23f5..bbbfe44c05e90846801f7d551c22f921d8d01d40 100644 (file)
--- a/convlog.c
+++ b/convlog.c
@@ -43,7 +43,7 @@ void convlog(const char *arq, char df, int dfrom, int duntil)
                arq="/var/log/squid/access.log";
 
        if((fp_in=MY_FOPEN(arq,"r"))==NULL) {
-               debuga(_("(convlog) Cannot open log file %s: %s\n"),arq,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),arq,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index 58317a0f657340dbcac79aed818502d4597547ed..399e684fa45d9cd9d3399058fd3f1052bd8d0eb4 100644 (file)
@@ -53,17 +53,17 @@ void dansguardian_log(void)
        snprintf(guard_ou,sizeof(guard_ou),"%s/dansguardian.int_log",tmp);
 
        if(access(DansGuardianConf, R_OK) != 0) {
-               debuga(_("Cannot open DansGuardian config file: %s\n"),DansGuardianConf);
+               debuga(_("Cannot open file \"%s\": %s\n"),DansGuardianConf,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if((fp_guard=fopen(DansGuardianConf,"r"))==NULL) {
-               debuga(_("(dansguardian) Cannot open log file %s: %s\n"),DansGuardianConf,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),DansGuardianConf,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=MY_FOPEN(guard_in,"w"))==NULL) {
-               debuga(_("(dansguardian) Cannot open log file %s: %s\n"),guard_in,strerror(errno));
+               debuga(_("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: %s\n"),loglocation,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),loglocation,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -143,7 +143,7 @@ void dansguardian_log(void)
        if(fp_in) fclose(fp_in);
        if(fp_guard) fclose(fp_guard);
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Write error in %s: %s"),guard_in,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),guard_in,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index cb850359d6f5ec65dcba75f0e7c326477f1c8cb3..74cf8d36cf21fbd5494d18d811eb03f3da66b271 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: %s\n"),dansguardian_in,strerror(errno));
+               debuga(_("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: %s\n"),report,strerror(errno));
+               debuga(_("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(_("Write error in %s: %s\n"),report,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index 1e4088f5b3987ef4848ac1e92e7c736b2572f07f..1a62f6bf419c4bf2f7c26192c3d2af9676dfec39 100644 (file)
@@ -92,7 +92,7 @@ void data_file(char *tmp)
                }
 
                if((fp_in=MY_FOPEN(tmp3,"r"))==NULL){
-                       debuga(_("(datafile) Cannot open file %s: %s\n"),tmp3,strerror(errno));
+                       debuga(_("Cannot open file \"%s\": %s\n"),tmp3,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
@@ -148,7 +148,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: %s\n"),DataFile,strerror(errno));
+                                       debuga(_("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);
@@ -196,7 +196,7 @@ void data_file(char *tmp)
        userinfo_stopscan(uscan);
        if (oldurl) free(oldurl);
        if (fp_ou && fclose(fp_ou)==EOF) {
-               debuga(_("Write error in %s: %s\n"),DataFile,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),DataFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index bd5a870b3558c5bb66e1e147c10d08b6619aff9d..a3e6b8267fd80c14a80eb264a5a384e42601b58e 100644 (file)
--- a/decomp.c
+++ b/decomp.c
@@ -54,7 +54,11 @@ FILE *decomp(const char *arq, bool *pipe)
 
        arqlen=strlen(arq);
        if(arqlen>3 && strcmp(arq+arqlen-3,".gz") == 0) {
-               debuga(_("Decompressing log file \"%s\" with zcat\n"),arq);
+               /*
+                TRANSLATORS: The last %s is the command used to uncompress
+                the log file such as zcat ou bzip2.
+                */
+               debuga(_("Decompressing log file \"%s\" with %s\n"),arq,"zcat");
                if (snprintf(cmd,sizeof(cmd),"zcat \"%s\"",arq)>=sizeof(cmd)) {
                        debuga(_("decompression command too long for log file %s\n"),arq);
                        exit(EXIT_FAILURE);
@@ -63,7 +67,7 @@ FILE *decomp(const char *arq, bool *pipe)
                fi=popen(cmd,"r");
        }
        else if(arqlen>4 && strcmp(arq+arqlen-4,".bz2") == 0) {
-               debuga(_("Decompressing log file \"%s\" with bzcat\n"),arq);
+               debuga(_("Decompressing log file \"%s\" with %s\n"),arq,"bzcat");
                if (snprintf(cmd,sizeof(cmd),"bzcat \"%s\"",arq)>=sizeof(cmd)) {
                        debuga(_("decompression command too long for log file %s\n"),arq);
                        exit(EXIT_FAILURE);
@@ -72,7 +76,7 @@ FILE *decomp(const char *arq, bool *pipe)
                fi=popen(cmd,"r");
        }
        else if(arqlen>2 && strcmp(arq+arqlen-2,".Z") == 0) {
-               debuga(_("Decompressing log file \"%s\" with zcat\n"),arq);
+               debuga(_("Decompressing log file \"%s\" with %s\n"),arq,"zcat");
                if (snprintf(cmd,sizeof(cmd),"zcat \"%s\"",arq)>=sizeof(cmd)) {
                        debuga(_("decompression command too long for log file %s\n"),arq);
                        exit(EXIT_FAILURE);
index 4288315aa14cb3c79739991f00c6f90c7fa61c23..188d6ffd98783d30fd401724a89c2e546b395498 100644 (file)
--- a/denied.c
+++ b/denied.c
@@ -53,7 +53,7 @@ void denied_open(void)
 
        snprintf(denied_unsort,sizeof(denied_unsort),"%s/denied.int_unsort",tmp);
        if ((fp_denied=MY_FOPEN(denied_unsort,"w"))==NULL) {
-               debuga(_("(log) Cannot open file %s: %s\n"),denied_unsort,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),denied_unsort,strerror(errno));
                exit(EXIT_FAILURE);
        }
        return;
@@ -82,7 +82,7 @@ void denied_close(void)
 {
        if (fp_denied) {
                if (fclose(fp_denied)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),denied_unsort,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),denied_unsort,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                fp_denied=NULL;
@@ -162,7 +162,7 @@ void gen_denied_report(void)
                exit(EXIT_FAILURE);
        }
        if (unlink(denied_unsort)) {
-               debuga(_("Cannot delete %s - %s\n"),denied_unsort,strerror(errno));
+               debuga(_("Cannot delete \"%s\": %s\n"),denied_unsort,strerror(errno));
                exit(EXIT_FAILURE);
        }
        denied_unsort[0]='\0';
@@ -170,12 +170,12 @@ void gen_denied_report(void)
        sprintf(report,"%s/denied.html",outdirname);
 
        if((fp_in=MY_FOPEN(denied_sort,"r"))==NULL) {
-               debuga(_("(denied) Cannot open log file %s: %s\n"),denied_sort,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),denied_sort,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if((fp_ou=MY_FOPEN(report,"w"))==NULL) {
-               debuga(_("(denied) Cannot open log file %s: %s\n"),report,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -272,7 +272,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(_("Write error in %s: %s\n"),report,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -289,7 +289,7 @@ void denied_cleanup(void)
 {
        if (fp_denied){
                if (fclose(fp_denied)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),denied_unsort,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),denied_unsort,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                fp_denied=NULL;
index 675f50aea54b9de059ef85bb936b5661b6df6a09..2dd8f1335c064ac524ca8065981ed9eb1f11b3a1 100644 (file)
@@ -71,7 +71,7 @@ void download_open(void)
 
        snprintf(download_unsort,sizeof(download_unsort),"%s/download.int_unsort",tmp);
        if ((fp_download=MY_FOPEN(download_unsort,"w"))==NULL) {
-               debuga(_("(log) Cannot open file %s: %s\n"),download_unsort,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),download_unsort,strerror(errno));
                exit(EXIT_FAILURE);
        }
        return;
@@ -102,7 +102,7 @@ void download_close(void)
        if (fp_download)
        {
                if (fclose(fp_download)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),download_unsort,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),download_unsort,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                fp_download=NULL;
@@ -205,12 +205,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: %s\n"),report_in,strerror(errno));
+               debuga(_("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: %s\n"),report,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -303,7 +303,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(_("Write error in %s: %s\n"),report,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -451,7 +451,7 @@ void download_cleanup(void)
 {
        if (fp_download) {
                if (fclose(fp_download)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),download_unsort,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),download_unsort,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                fp_download=NULL;
diff --git a/email.c b/email.c
index c32608ef1a6cd89c5c9e9dbacf6aa7acd6bf95fe..5f639c24bd20887327b555c1071531bcf42756df 100644 (file)
--- a/email.c
+++ b/email.c
@@ -58,13 +58,13 @@ 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: %s\n"),wger,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),wger,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: %s\n"),top2,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),top2,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -117,7 +117,7 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema
        }
 
        if (fclose(fp_top2)==EOF) {
-               debuga(_("Write error in %s: %s\n"),top2,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),top2,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -145,13 +145,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: %s\n"),top1,strerror(errno));
+               debuga(_("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: %s\n"),top3,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),top3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -260,13 +260,13 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema
        fprintf(fp_top3, "\n%s\n", asctime(local));
 
        if (fclose(fp_top3)==EOF) {
-               debuga(_("Write error in %s: %s\n"),top3,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),top3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
        if(strcmp(email,"stdout") == 0) {
                if((fp_top3=fopen(top3,"r"))==NULL) {
-                       debuga(_("(email) Cannot open file %s: %s\n"),top3,strerror(errno));
+                       debuga(_("Cannot open file \"%s\": %s\n"),top3,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
index 2f23e23c8592a823376ae051c1cfdadcfa76044e..cebe1911499dce5b2fb31ff0f2c1e51a1ab06b9c 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));
+               debuga(_("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));
+               debuga(_("Cannot open file \"%s\": %s\n"),uexfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index 49f6c886216f8b8f5f0ae5e194946b48dc3c0a40..74bdeee4c36fab6a63f592c6468b2b9c9b10fb93 100644 (file)
--- a/getconf.c
+++ b/getconf.c
@@ -966,7 +966,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);
+               debuga(_("Cannot open file \"%s\": %s\n"),ConfigFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index ab68c05c4b3737da3cb52e4eb3786dc6ceec7abc..8c5516504ee863d8c2e0c91b43064f18069a3bf0 100644 (file)
--- a/grepday.c
+++ b/grepday.c
@@ -154,7 +154,7 @@ 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));
+                       debuga(_("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 {
@@ -616,12 +616,12 @@ 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: %s\n"),graph,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),graph,strerror(errno));
                exit(EXIT_FAILURE);
        }
        gdImagePng(gdata.im, pngout);
        if (fclose(pngout)==EOF) {
-               debuga(_("Write error in %s: %s\n"),graph,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),graph,strerror(errno));
        }
        gdImageDestroy(gdata.im);
 
@@ -645,14 +645,14 @@ void greport_prepare(void)
        }
 
        if(access(GraphFont, R_OK) != 0) {
-               debuga(_("(grepday) Fontname %s not found\n"),GraphFont);
+               debuga(_("Font name %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));
+               debuga(_("iconv cannot convert from %s to UTF-8: %s\n"),CharSet,strerror(errno));
        }
 #endif
 
@@ -686,7 +686,7 @@ void greport_day(const struct userinfostruct *uinfo)
        }
 
        if((fp_in=fopen(wdirname,"r"))==NULL) {
-               debuga(_("(grepday) Cannot open log file %s: %s\n"),wdirname,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -728,7 +728,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: %s\n"),wdirname,strerror(errno));
+               debuga(_("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);
@@ -765,7 +765,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(_("Write error in %s: %s\n"),wdirname,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),wdirname,strerror(errno));
 #endif //HAVE_GD
 
        return;
diff --git a/html.c b/html.c
index bba3f92153241f3bcc3cf54d94b8674b29a06ac1..5601bf2a048aaf0ab3f0f74ef98cb9916b2e3870 100644 (file)
--- a/html.c
+++ b/html.c
@@ -94,7 +94,7 @@ void htmlrel(void)
                        for (i=0 ; i<PerUserLimitsNumber ; i++) {
                                FILE *fp_usr=fopen(PerUserLimits[i].File,"wt");
                                if (fp_usr==NULL) {
-                                       debuga(_("Cannot create empty per_user_limit file \"%s\": %s"),PerUserLimits[i].File,
+                                       debuga(_("Cannot create empty per_user_limit file \"%s\": %s\n"),PerUserLimits[i].File,
                                                   strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
@@ -105,7 +105,7 @@ void htmlrel(void)
                case PUFC_AsRequired:
                        for (i=0 ; i<PerUserLimitsNumber ; i++) {
                                if (access(PerUserLimits[i].File,R_OK)==0 && unlink(PerUserLimits[i].File)==-1) {
-                                       debuga(_("Cannot delete per_user_limit file \"%s\": %s"),PerUserLimits[i].File,
+                                       debuga(_("Cannot delete \"%s\": %s\n"),PerUserLimits[i].File,
                                                   strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
@@ -132,7 +132,7 @@ void htmlrel(void)
 
                if (access(warea, R_OK) != 0) {
                        if (PortableMkDir(warea,0755)) {
-                               debuga(_("Cannot create directory %s - %s\n"),warea,strerror(errno));
+                               debuga(_("Cannot create directory \"%s\": %s\n"),warea,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                }
@@ -144,7 +144,7 @@ void htmlrel(void)
                }
                if ((fp_in = fopen(arqin, "r")) == 0){
                        if (uinfo->no_report) continue;
-                       debuga(_("(html3) Cannot open file %s: %s\n"),arqin,strerror(errno));
+                       debuga(_("Cannot open file \"%s\": %s\n"),arqin,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
@@ -216,7 +216,7 @@ void htmlrel(void)
                rewind(fp_in);
 
                if ((fp_ou = fopen(arqou, "w")) == 0){
-                       debuga(_("(html5) Cannot open file %s: %s\n"),arqou,strerror(errno));
+                       debuga(_("Cannot open file \"%s\": %s\n"),arqou,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
@@ -379,12 +379,12 @@ void htmlrel(void)
                                }
 
                                if ((fp_ip = fopen(arqip, "r")) == 0){
-                                       debuga(_("(html6) Cannot open file %s: %s\n"),arqip,strerror(errno));
+                                       debuga(_("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: %s\n"),tmp2,strerror(errno));
+                                       debuga(_("Cannot open file \"%s\": %s\n"),tmp2,strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
 
@@ -425,7 +425,7 @@ void htmlrel(void)
 
                                fclose(fp_ip);
                                if (fclose(fp_ip2)==EOF) {
-                                       debuga(_("Write error in %s: %s\n"),tmp2,strerror(errno));
+                                       debuga(_("Write error in \"%s\": %s\n"),tmp2,strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
 
@@ -441,7 +441,7 @@ void htmlrel(void)
                                }
 
                                if ((fp_ip = MY_FOPEN(tmp3, "r")) == 0) {
-                                       debuga(_("(html8) Cannot open file %s: %s\n"),tmp3,strerror(errno));
+                                       debuga(_("Cannot open file \"%s\": %s\n"),tmp3,strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
 
@@ -581,7 +581,7 @@ void htmlrel(void)
                                        FILE *fp_usr;
 
                                        if((fp_usr = fopen(PerUserLimits[i].File, "at")) == 0) {
-                                               debuga(_("(html10) Cannot open per user limit file %s: %s\n"),PerUserLimits[i].File,strerror(errno));
+                                               debuga(_("Cannot open file \"%s\": %s\n"),PerUserLimits[i].File,strerror(errno));
                                                exit(EXIT_FAILURE);
                                        }
                                        switch (PerUserLimits[i].Output)
@@ -634,7 +634,7 @@ void htmlrel(void)
                if (write_html_trailer(fp_ou)<0)
                        debuga(_("Write error in file %s\n"),arqou);
                if (fclose(fp_ou)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),arqou,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),arqou,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
diff --git a/index.c b/index.c
index 0c1cb62cb00463ce2d5c86193da7ca5a7ef1da98..5e6e2a976a8b2e42cef5c92f2f74d7562360f10c 100644 (file)
--- a/index.c
+++ b/index.c
@@ -153,7 +153,7 @@ static long long int get_size(char *path,int path_size)
                exit(EXIT_FAILURE);
        }
        if ((dirp=opendir(path))==NULL) {
-               debuga(_("Cannot open directory %s: %s\n"),path,strerror(errno));
+               debuga(_("Cannot open directory \"%s\": %s\n"),path,strerror(errno));
                exit(EXIT_FAILURE);
        }
        path[path_len++]='/';
@@ -302,7 +302,7 @@ static long long int make_date_index_day(char *monthdir,int monthdir_size,int or
 
        strcpy(monthdir+monthdir_len,INDEX_HTML_FILE);
        if((fp_ou=fopen(monthdir,"w"))==NULL) {
-               debuga(_("(index) Cannot open file %s: %s\n"),monthdir,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),monthdir,strerror(errno));
                exit(EXIT_FAILURE);
        }
        snprintf(title,sizeof(title),ngettext("SARG: report for %s/%s","SARG: reports for %s/%s",ndays),yearnum,monthnum);
@@ -462,7 +462,7 @@ static long long int make_date_index_month(char *yeardir,int yeardir_size,int or
 
        strcpy(yeardir+yeardir_len,INDEX_HTML_FILE);
        if((fp_ou=fopen(yeardir,"w"))==NULL) {
-               debuga(_("(index) Cannot open file %s: %s\n"),yeardir,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),yeardir,strerror(errno));
                exit(EXIT_FAILURE);
        }
        snprintf(title,sizeof(title),ngettext("SARG: report for %s","SARG: reports for %s",nmonths),yearnum);
@@ -589,7 +589,7 @@ static void make_date_index(void)
                exit(EXIT_FAILURE);
        }
        if((fp_ou=fopen(yearindex,"w"))==NULL) {
-               debuga(_("(index) Cannot open file %s: %s\n"),yearindex,strerror(errno));
+               debuga(_("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);
@@ -636,7 +636,7 @@ static void make_date_index(void)
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in the index %s\n"),yearindex);
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Write error in %s: %s\n"),yearindex,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),yearindex,strerror(errno));
                exit(EXIT_FAILURE);
        }
 }
@@ -767,7 +767,7 @@ static void make_file_index(void)
        closedir( dirp );
 
        if((fp_ou=fopen(wdir,"w"))==NULL) {
-               debuga(_("(index) Cannot open file %s: %s\n"),wdir,strerror(errno));
+               debuga(_("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);
@@ -887,7 +887,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 (PortableMkDir(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);
                }
        }
@@ -895,7 +895,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 (PortableMkDir(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);
                }
        }
@@ -905,7 +905,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));
+               debuga(_("Error renaming \"%s\" to \"%s\": %s\n"),olddir,newdir,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -916,7 +916,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
@@ -1007,7 +1007,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));
+                               debuga(_("Error renaming \"%s\" to \"%s\": %s\n"),olddir,newdir,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                }
diff --git a/log.c b/log.c
index 99df56212fb68876ffd70bdf1fc7f8fd1921e6db..a7a98bf3fbd71f32fdd57011ff7bcdfd29a07989 100644 (file)
--- a/log.c
+++ b/log.c
@@ -442,7 +442,7 @@ int main(int argc,char *argv[])
 
        if(ConfigFile[0] == '\0') snprintf(ConfigFile,sizeof(ConfigFile),"%s/sarg.conf",SYSCONFDIR);
        if(access(ConfigFile, R_OK) != 0) {
-               debuga(_("Cannot open config file: %s - %s\n"),ConfigFile,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),ConfigFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -648,7 +648,7 @@ int main(int argc,char *argv[])
 #warning "No rlimit resource for the number of open files"
 #endif
                if(rc == -1) {
-                       debuga(_("setrlimit error - %s\n"),strerror(errno));
+                       debuga(_("setrlimit error: %s\n"),strerror(errno));
                }
 
                if(debug)
@@ -760,7 +760,7 @@ 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));
+               debuga(_("Cannot open file \"%s\": %s\n"),pwdfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -780,7 +780,7 @@ static void getusers(const char *pwdfile, int debug)
        }
 
        if((userfile=(char *) malloc(nreg))==NULL){
-               debuga(_("malloc error (%ld)\n"),nreg);
+               debuga(_("malloc error (%ld bytes required)\n"),nreg);
                exit(EXIT_FAILURE);
        }
 
index b92406710806c3f87e81142405a85c7508664480..6bf1a0f49d505bbc3f71f688529eeeb45457014c 100644 (file)
--- a/readlog.c
+++ b/readlog.c
@@ -417,7 +417,7 @@ static void ReadOneLogFile(struct ReadLogDataStruct *Filter,const char *arq)
                                exit(EXIT_FAILURE);
                        }
                        if((fp_log=MY_FOPEN(SargLogFile,"w"))==NULL) {
-                               debuga(_("(log) Cannot open log file %s: %s\n"),SargLogFile,strerror(errno));
+                               debuga(_("Cannot open file \"%s\": %s\n"),SargLogFile,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                        fputs("*** SARG Log ***\n",fp_log);
@@ -796,7 +796,7 @@ int ReadLogFile(struct ReadLogDataStruct *Filter)
                char val4[4096];//val4 must not be bigger than SargLogFile without fixing the strcpy below
 
                if (fclose(fp_log)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),SargLogFile,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),SargLogFile,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                strftime(val2,sizeof(val2),"%d%m%Y_%H%M",&period.start);
index 4e8560ed84ca84ac28b036e0ce550fe063bb0b8d..37e0dd2139c8084dd2d644f31937cdc1e1048c4a 100644 (file)
@@ -67,7 +67,7 @@ static bool GetLatestModified(char *file_name,int file_name_size)
        while ((file=FileListIter_Next(FIter))!=NULL)
        {
                if (stat(file,&st)==-1) {
-                       debuga(_("Cannot stat \"%s\": %s"),file,strerror(errno));
+                       debuga(_("Cannot stat \"%s\": %s\n"),file,strerror(errno));
                }
                if (!found)
                {
index 7f29d8ca1e5fde125a1dfd9c8acea028355745f9..e0f696c6de287a0675548638cd29a095b91cb556 100644 (file)
@@ -265,7 +265,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: %s\n"),wentp,strerror(errno));
+               debuga(_("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);
        if((fp_ou=fopen(guard_in,"w"))==NULL) {
-               debuga(_("(squidguard) Cannot open log file %s: %s\n"),guard_in,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),guard_in,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -319,12 +319,12 @@ void redirector_log(void)
                        read_log(RedirectorLogs[i],fp_ou,dfrom,duntil);
        } else {
                if(access(SquidGuardConf, R_OK) != 0) {
-                       debuga(_("Cannot open squidGuard config file: %s\n"),SquidGuardConf);
+                       debuga(_("Cannot open file \"%s\": %s\n"),SquidGuardConf,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
                if((fp_guard=fopen(SquidGuardConf,"r"))==NULL) {
-                       debuga(_("(squidguard) Cannot open log file %s: %s\n"),SquidGuardConf,strerror(errno));
+                       debuga(_("Cannot open file \"%s\": %s\n"),SquidGuardConf,strerror(errno));
                        exit(EXIT_FAILURE);
                }
 
@@ -377,7 +377,7 @@ void redirector_log(void)
 
        if (fp_guard) fclose(fp_guard);
        if (fp_ou && fclose(fp_ou)==EOF) {
-               debuga(_("Write error in %s: %s\n"),guard_in,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),guard_in,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -459,12 +459,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: %s\n"),redirector_sorted,strerror(errno));
+               debuga(_("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: %s\n"),report,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -580,7 +580,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(_("Write error in %s: %s\n"),report,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index 54ac69122f424a205cf4045b4cd8c2299d649e54..65a43c985cf8a4ba91985e89e5230a141c1fcf09 100644 (file)
--- a/repday.c
+++ b/repday.c
@@ -68,7 +68,7 @@ void report_day(const struct userinfostruct *uinfo)
        }
 
        if((fp_in=fopen(wdirname,"r"))==NULL) {
-               debuga(_("(repday) Cannot open log file %s: %s\n"),wdirname,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -121,7 +121,7 @@ void report_day(const struct userinfostruct *uinfo)
        fclose(fp_in);
 
        if((fp_ou=fopen(arqout,"w"))==NULL) {
-               debuga(_("(repday) Cannot open output file %s: %s\n"),arqout,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),arqout,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -246,7 +246,7 @@ 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(_("Write error in %s: %s\n"),arqout,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),arqout,strerror(errno));
                exit(EXIT_FAILURE);
        }
        return;
index b0f95402f590c1cbbdcef525b914f5f5cac3b7e3..666432f4d4ed2b3303b2ed35825b7f13998bc025 100644 (file)
--- a/report.c
+++ b/report.c
@@ -104,7 +104,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: %s\n"),wdirname,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -124,11 +124,12 @@ 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);
+                       debuga(_("Path too long: "));
+                       debuga_more("%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: %s\n"),tmp,strerror(errno));
+                       debuga(_("Cannot open file \"%s\": %s\n"),tmp3,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                user=uinfo->filename;
@@ -251,7 +252,7 @@ void gerarel(void)
                                                my_mkdir(arqtt);
                                        snprintf(arqtt,sizeof(arqtt),"%s/%s/tt.html",outdirname,uinfo->filename);
                                        if ((fp_tt = fopen(arqtt, "w")) == 0) {
-                                               debuga(_("(report) Cannot open file %s: %s\n"),arqtt,strerror(errno));
+                                               debuga(_("Cannot open file \"%s\": %s\n"),arqtt,strerror(errno));
                                                exit(EXIT_FAILURE);
                                        }
                                        ttopen=1;
@@ -363,7 +364,7 @@ void gerarel(void)
 
        totalger(fp_gen,wdirname);
        if (fclose(fp_gen)==EOF) {
-               debuga(_("Write error in %s: %s\n"),wdirname,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -450,7 +451,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: %s\n"),wdirname,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -477,7 +478,7 @@ static void closett(void)
                fputs("</table>\n</div>\n",fp_tt);
                fputs("</body>\n</html>\n",fp_tt);
                if (fclose(fp_tt)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),arqtt,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),arqtt,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                fp_tt=NULL;
@@ -498,7 +499,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: %s\n"),wdirname,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -509,7 +510,7 @@ static void gravaporuser(const struct userinfostruct *uinfo, const char *dirname
        fprintf(fp_ou,"%s\t%s\t%s\t%s\t%"PRIu64"\t%"PRIu64"\n",ip,url,data,hora,(uint64_t)tam,(uint64_t)elap);
 
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Write error in %s: %s\n"),wdirname,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -786,7 +787,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: %s\n"),wdirname,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -794,7 +795,7 @@ static void grava_SmartFilter(const char *dirname, const char *user, const char
        fputs("</body>\n</html>\n",fp_tt);
 
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Write error in %s: %s\n"),wdirname,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),wdirname,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index b99bcb0e7745ebe7f98251f85f3ee0415aab8e2e..3dde6e3c436a655d4a5b1c1e4abe5d3fda12f4aa 100644 (file)
@@ -73,13 +73,13 @@ void siteuser(void)
        }
 
        if((fp_in=fopen(general2,"r"))==NULL) {
-               debuga(_("(siteuser) Cannot open log file %s: %s\n"),general2,strerror(errno));
+               debuga(_("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: %s\n"),report,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -192,7 +192,7 @@ void siteuser(void)
        if (write_html_trailer(fp_ou)<0)
                debuga(_("Write error in file %s\n"),report);
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Write error in %s: %s\n"),report,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index 7b9a9dab5fce01eea103490a09d109cbb31cc0f5..104a372e86fd84a737fbb310b6aca90a74d5bd7f 100644 (file)
@@ -84,7 +84,7 @@ void smartfilter_report(void)
                exit(EXIT_FAILURE);
        }
        if((fp_in=fopen(smart_ou,"r"))==NULL) {
-               debuga(_("(smartfilter) Cannot open log file %s: %s\n"),smart_ou,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),smart_ou,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
@@ -94,7 +94,7 @@ void smartfilter_report(void)
        }
 
        if((fp_ou=fopen(report,"w"))==NULL) {
-               debuga(_("(smartfilter) Cannot open log file %s: %s\n"),report,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -145,13 +145,13 @@ void smartfilter_report(void)
                                }
                                fputs("</body>\n</html>\n",fp_user);
                                if (fclose(fp_user)==EOF) {
-                                       debuga(_("Write error in %s: %s\n"),smartuser,strerror(errno));
+                                       debuga(_("Write error in \"%s\": %s\n"),smartuser,strerror(errno));
                                        exit(EXIT_FAILURE);
                                }
                                fp_user=NULL;
                        }
                        if ((fp_user = fopen(smartuser, "a")) == 0) {
-                               debuga(_("(smartfilter) Cannot open file %s: %s\n"),smartuser,strerror(errno));
+                               debuga(_("Cannot open file \"%s\": %s\n"),smartuser,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
 
@@ -204,7 +204,7 @@ void smartfilter_report(void)
        fputs("</body>\n</html>\n",fp_user);
 
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Write error in %s: %s\n"),report,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
        if(fp_user) {
@@ -215,7 +215,7 @@ void smartfilter_report(void)
                }
                fputs("</body>\n</html>\n",fp_user);
                if (fclose(fp_user)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),smartuser,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),smartuser,strerror(errno));
                        exit(EXIT_FAILURE);
                }
        }
index b55c721ad3712e95683d72a68a5ce3a84abe6634..5c829839bb6351ae427de37df9b40acf9d8b4610 100644 (file)
@@ -80,7 +80,7 @@ void splitlog(const char *arq, char df, int dfrom, int duntil, int convert, cons
                arq="/var/log/squid/access.log";
 
        if((fp_in=MY_FOPEN(arq,"r"))==NULL) {
-               debuga(_("(splitlog) Cannot open log file %s: %s\n"),arq,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),arq,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -110,7 +110,7 @@ void splitlog(const char *arq, char df, int dfrom, int duntil, int convert, cons
                        prev_month=t->tm_mon;
                        prev_day=t->tm_mday;
                        if (fp_ou && fclose(fp_ou)==EOF) {
-                               debuga(_("Write error in %s: %s\n"),output_file,strerror(errno));
+                               debuga(_("Write error in \"%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);
@@ -120,7 +120,7 @@ void splitlog(const char *arq, char df, int dfrom, int duntil, int convert, cons
                        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));
+                               debuga(_("Cannot open file \"%s\": %s\n"),output_file,strerror(errno));
                                exit(EXIT_FAILURE);
                        }
                        if (tt<min_tt) min_tt=tt;
@@ -145,7 +145,7 @@ void splitlog(const char *arq, char df, int dfrom, int duntil, int convert, cons
        }
        if (autosplit && fp_ou) {
                if (fclose(fp_ou)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),output_file,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),output_file,strerror(errno));
                        exit(EXIT_FAILURE);
                }
        }
index 0e4f83ab181a722340e2196ccbcdb6d88b0b55e0..aca660114f5b0493aa2825b1159001787bee7e69 100644 (file)
@@ -94,13 +94,13 @@ void topsites(void)
        }
 
        if((fp_in=fopen(general2,"r"))==NULL) {
-               debuga(_("(topsites) Cannot open log file %s: %s\n"),general2,strerror(errno));
+               debuga(_("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: %s\n"),general3,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),general3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -175,7 +175,7 @@ void topsites(void)
        }
 
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Write error in %s: %s\n"),general3,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),general3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -219,7 +219,7 @@ void topsites(void)
                exit(EXIT_FAILURE);
        }
        if((fp_in=fopen(sites,"r"))==NULL) {
-               debuga(_("(topsites) Cannot open log file %s: %s\n"),sites,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),sites,strerror(errno));
                debuga(_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
@@ -230,7 +230,7 @@ void topsites(void)
        }
 
        if((fp_ou=fopen(report,"w"))==NULL) {
-               debuga(_("(topsites) Cannot open log file %s: %s\n"),report,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -323,7 +323,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(_("Write error in %s: %s\n"),report,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),report,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index 7618248fd0bc0277b09e03404e147df3d0a529c6..8ac55bdc06439c54bd7e0305a9ee3018aee2adb5 100644 (file)
--- a/topuser.c
+++ b/topuser.c
@@ -43,12 +43,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: %s\n"),tusr,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),tusr,strerror(errno));
                exit(EXIT_FAILURE);
        }
        fprintf(fp_ou,"%d\n",totuser);
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Write error in %s: %s\n"),tusr,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),tusr,strerror(errno));
                exit(EXIT_FAILURE);
        }
        globstat.totuser=totuser;
@@ -89,13 +89,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: %s\n"),wger,strerror(errno));
+               debuga(_("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: %s\n"),top2,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),top2,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -157,7 +157,7 @@ void topuser(void)
                ttnoucache+=tnoucache;
        }
        if (fclose(fp_top2)==EOF) {
-               debuga(_("Write error in %s: %s\n"),top2,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),top2,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -205,7 +205,7 @@ void topuser(void)
        }
 
        if((fp_top1=fopen(top1,"r"))==NULL) {
-               debuga(_("(topuser) Cannot open file %s: %s\n"),top1,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),top1,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -216,7 +216,7 @@ void topuser(void)
 
        snprintf(top3,sizeof(top3),"%s/"INDEX_HTML_FILE,outdirname);
        if((fp_top3=fopen(top3,"w"))==NULL) {
-               debuga(_("(topuser) Cannot open file %s: %s\n"),top3,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),top3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -255,7 +255,7 @@ void topuser(void)
        if ((ReportType & REPORT_TYPE_TOPUSERS) == 0) {
                fputs("</body>\n</html>\n",fp_top3);
                if (fclose (fp_top3)==EOF) {
-                       debuga(_("Write error in %s: %s\n"),top3,strerror(errno));
+                       debuga(_("Write error in \"%s\": %s\n"),top3,strerror(errno));
                        exit(EXIT_FAILURE);
                }
                if (debugz>=LogLevel_Process) debugaz(_("No top users report because it is not configured in report_type\n"));
@@ -499,7 +499,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(_("Write error in %s: %s\n"),top3,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),top3,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index e59981134574ff45964333ef741c28465b864299..a02a1e5c186a29878dc2708049f183a4dcd59898 100644 (file)
--- a/totday.c
+++ b/totday.c
@@ -157,7 +157,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: %s\n"),arqout,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),arqout,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -180,7 +180,7 @@ void day_totalize(DayObject ddata,const char *tmp, const struct userinfostruct *
        }
 
        if (fclose(fp_ou)==EOF) {
-               debuga(_("Write error in %s: %s\n"),arqout,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),arqout,strerror(errno));
                exit(EXIT_FAILURE);
        }
        return;
@@ -204,6 +204,6 @@ void day_deletefile(const struct userinfostruct *uinfo)
        }
 
        if (unlink(arqout))
-               debuga(_("Cannot delete temporary day file \"%s\": %s\n"),arqout,strerror(errno));
+               debuga(_("Cannot delete \"%s\": %s\n"),arqout,strerror(errno));
 }
 
diff --git a/url.c b/url.c
index 2f0de542fc93c8c3a1745964949d3e1d7c29d913..ca2318cafeb6c14423fe3a0370296a420b8899f7 100644 (file)
--- a/url.c
+++ b/url.c
@@ -581,7 +581,7 @@ void read_hostalias(const char *Filename)
        if (debug) debuga(_("Reading host alias file \"%s\"\n"),Filename);
        fi=fopen(Filename,"rt");
        if (!fi) {
-               debuga(_("Cannot read host name alias file \"%s\" - %s\n"),Filename,strerror(errno));
+               debuga(_("Cannot read host name alias file \"%s\": %s\n"),Filename,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index 77a9acfdbd8f707d47e69443a4abad5a1f30e3ff..c100f843035524f7fdc0c6da189c219c3f2db233 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: %s\n"),UserAgentLog,strerror(errno));
+               debuga(_("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: %s\n"),tmp3,strerror(errno));
+               debuga(_("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(_("Write error in %s: %s\n"),tmp3,strerror(errno));
+               debuga(_("Write error in \"%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: %s\n"),tmp2,strerror(errno));
+               debuga(_("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: %s\n"),hfile,strerror(errno));
+               debuga(_("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: %s\n"),tmp3,strerror(errno));
+               debuga(_("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: %s\n"),tmp2,strerror(errno));
+               debuga(_("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(_("Write error in %s: %s\n"),tmp3,strerror(errno));
+               debuga(_("Write error in \"%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: %s\n"),tmp3,strerror(errno));
+               debuga(_("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(_("Write error in %s: %s\n"),hfile,strerror(errno));
+               debuga(_("Write error in \"%s\": %s\n"),hfile,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index 89be0ddbb552e766968861c4176c98c8ccaabc55..e87db5ed913c07360e6a8f8fce8840944a933832 100644 (file)
@@ -325,7 +325,7 @@ void read_useralias(const char *Filename)
 
        fi=fopen(Filename,"rt");
        if (!fi) {
-               debuga(_("Cannot read user name alias file \"%s\" - %s\n"),Filename,strerror(errno));
+               debuga(_("Cannot read user name alias file \"%s\": %s\n"),Filename,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
index f943685778ffa7cb63751a6c66a04c310714b9bd..5e6aa82f5e4b8c53208221f00fedc4ebde2b9cc1 100644 (file)
--- a/usertab.c
+++ b/usertab.c
@@ -76,7 +76,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));
+               debuga(_("Cannot open file \"%s\": %s\n"),UserTabFile,strerror(errno));
                exit(EXIT_FAILURE);
        }
        if (fseek(fp_usr, 0, SEEK_END)==-1) {
@@ -233,7 +233,7 @@ const char * charset_convert( const char * str_in, const char * charset_to )
        str_in_orig = str_in;
        return_value = iconv(ldapiconv, (ICONV_CONST char **)&str_in, &str_in_len, &str_out, &str_out_len );
        if ( return_value == ( size_t ) -1 ) {
-               debuga(_("iconv failed: in string '%s':\n"),str_in_orig);
+               debuga(_("iconv failed in string \"%s\":\n"),str_in_orig);
                switch ( errno ) {
                        /* See "man 3 iconv" for an explanation. */
                        case EILSEQ:
diff --git a/util.c b/util.c
index dcfdc7d5addc0c8a60b11ddbd64f6ba72fa1e188..71c6f3f24e8356e8fb5bca96ee2352d3db0d7e41 100644 (file)
--- a/util.c
+++ b/util.c
@@ -191,13 +191,20 @@ 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 function name (in the source code) where the
+                        overflow is detected.
+                       */
+                       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(_("End of number not found in getword_atoll after %d bytes.\n"),x);
+               /*
+                TRANSLATORS: The %s is the function name, in the source code, where the problem occured.
+               */
+               debuga(_("End of number not found 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);
@@ -229,13 +236,13 @@ 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);
+                       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(_("End of number not found in getword_atoi after %d bytes.\n"),x);
+               debuga(_("End of number not found 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);
@@ -267,13 +274,13 @@ int getword_atol(long int *number, struct getwordstruct *gwarea, char stop)
        for(x=0;isdigit(gwarea->current[x]);x++) {
                digit=gwarea->current[x]-'0';
                if (*number > (LONG_MAX-digit)/10) {
-                       debuga(_("Integer overflow detected in getword_atol in line %s\n"),gwarea->beginning);
+                       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(_("End of number not found in getword_atol after %ld bytes.\n"),x);
+               debuga(_("End of number not found in %s after %ld bytes.\n"),__func__,x);
                debuga(_("Line=\"%s\"\n"),gwarea->beginning);
                debuga(_("Record=\"%s\"\n"),gwarea->current);
                debuga(_("searching for \'x%x\'\n"),stop);
@@ -307,13 +314,13 @@ int getword_atolu(unsigned long int *number, struct getwordstruct *gwarea, char
        for(x=0;isdigit(gwarea->current[x]);x++) {
                digit=gwarea->current[x]-'0';
                if (*number > (ULONG_MAX-digit)/10) {
-                       debuga(_("Integer overflow detected in getword_atolu in line %s\n"),gwarea->beginning);
+                       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(_("End of number not found in getword_atolu after %ld bytes.\n"),x);
+               debuga(_("End of number not found in %s after %ld bytes.\n"),__func__,x);
                debuga(_("Line=\"%s\"\n"),gwarea->beginning);
                debuga(_("Record=\"%s\"\n"),gwarea->current);
                debuga(_("searching for \'x%x\'\n"),stop);
@@ -422,7 +429,7 @@ void my_mkdir(const char *name)
                        w0[i] = '\0';
                        if (access(w0, R_OK) != 0) {
                                if (PortableMkDir(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);
                                }
                        }
@@ -433,7 +440,7 @@ void my_mkdir(const char *name)
 
        if (access(name, R_OK) != 0) {
                if (PortableMkDir(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);
                }
        }
@@ -1082,14 +1089,14 @@ static void copy_images(void)
        }
        if (access(images,R_OK)!=0) {
                if (PortableMkDir(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);
                }
        }
 
        dirp = opendir(ImageDir);
        if(dirp==NULL) {
-               debuga(_("(util) Can't open directory %s: %s\n"),ImageDir,strerror(errno));
+               debuga(_("Cannot open directory \"%s\": %s\n"),ImageDir,strerror(errno));
                return;
        }
        while ((direntp = readdir( dirp )) != NULL ){
@@ -1101,7 +1108,7 @@ static void copy_images(void)
                        exit(EXIT_FAILURE);
                }
                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)) {
@@ -1125,10 +1132,10 @@ static void copy_images(void)
                                                exit(EXIT_FAILURE);
                                        }
                                } else
-                                       fprintf(stderr,"SARG: (util): %s %s: %s\n", _("Cannot open file")?_("Cannot open file"):"Can't open/create file", dstfile, strerror(errno));
+                                       debuga(_("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));
+                               debuga(_("Cannot open file \"%s\": %s\n"), srcfile, strerror(errno));
                }
        }
        (void) closedir(dirp);
@@ -1709,7 +1716,7 @@ void removetmp(const char *outdir)
                exit(EXIT_FAILURE);
        }
        if((fp_gen=fopen(filename,"w"))==NULL){
-               debuga(_("(removetmp) Cannot open file %s: %s\n"),filename,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),filename,strerror(errno));
                exit(EXIT_FAILURE);
        }
        totalger(fp_gen,filename);
@@ -1731,7 +1738,7 @@ void load_excludecodes(const char *ExcludeCodes)
                return;
 
        if((fp_in=fopen(ExcludeCodes,"r"))==NULL) {
-               debuga(_("(util) Cannot open file %s (exclude_codes): %s\n"),ExcludeCodes,strerror(errno));
+               debuga(_("Cannot open file \"%s\": %s\n"),ExcludeCodes,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -1751,7 +1758,7 @@ void load_excludecodes(const char *ExcludeCodes)
 
        MemSize+=1;
        if((excludecode=(char *) malloc(MemSize))==NULL) {
-               debuga(_("malloc error (%ld)\n"),MemSize);
+               debuga(_("malloc error (%ld bytes required)\n"),MemSize);
                exit(EXIT_FAILURE);
        }
        memset(excludecode,0,MemSize);
@@ -2168,7 +2175,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)) {
@@ -2263,7 +2270,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)) {
@@ -2305,7 +2312,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)) {