From: Frederic Marchal Date: Thu, 2 Apr 2015 19:08:06 +0000 (+0200) Subject: Normalize the messages to have less messages to translate. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=96dadc9f63dfb42b2ff2119f4f1901d7da9930ff;p=thirdparty%2Fsarg.git Normalize the messages to have less messages to translate. --- diff --git a/auth.c b/auth.c index 57d352e..bf54d61 100644 --- 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); diff --git a/authfail.c b/authfail.c index e3f62a6..a7dc5a5 100644 --- a/authfail.c +++ b/authfail.c @@ -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; diff --git a/convlog.c b/convlog.c index 3c22413..bbbfe44 100644 --- 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); } diff --git a/dansguardian_log.c b/dansguardian_log.c index 58317a0..399e684 100644 --- a/dansguardian_log.c +++ b/dansguardian_log.c @@ -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); } diff --git a/dansguardian_report.c b/dansguardian_report.c index cb85035..74cf8d3 100644 --- a/dansguardian_report.c +++ b/dansguardian_report.c @@ -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); } diff --git a/datafile.c b/datafile.c index 1e4088f..1a62f6b 100644 --- a/datafile.c +++ b/datafile.c @@ -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); } diff --git a/decomp.c b/decomp.c index bd5a870..a3e6b82 100644 --- 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); diff --git a/denied.c b/denied.c index 4288315..188d6ff 100644 --- 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; diff --git a/download.c b/download.c index 675f50a..2dd8f13 100644 --- a/download.c +++ b/download.c @@ -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 c32608e..5f639c2 100644 --- 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); } diff --git a/exclude.c b/exclude.c index 2f23e23..cebe191 100644 --- 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); } diff --git a/getconf.c b/getconf.c index 49f6c88..74bdeee 100644 --- 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); } diff --git a/grepday.c b/grepday.c index ab68c05..8c55165 100644 --- 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 bba3f92..5601bf2 100644 --- a/html.c +++ b/html.c @@ -94,7 +94,7 @@ void htmlrel(void) for (i=0 ; ino_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 0c1cb62..5e6e2a9 100644 --- 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 99df562..a7a98bf 100644 --- 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); } diff --git a/readlog.c b/readlog.c index b924067..6bf1a0f 100644 --- 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); diff --git a/realtime.c b/realtime.c index 4e8560e..37e0dd2 100644 --- a/realtime.c +++ b/realtime.c @@ -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) { diff --git a/redirector.c b/redirector.c index 7f29d8c..e0f696c 100644 --- a/redirector.c +++ b/redirector.c @@ -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); } diff --git a/repday.c b/repday.c index 54ac691..65a43c9 100644 --- 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; diff --git a/report.c b/report.c index b0f9540..666432f 100644 --- 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("\n\n",fp_tt); fputs("\n\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("\n\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); } diff --git a/siteuser.c b/siteuser.c index b99bcb0..3dde6e3 100644 --- a/siteuser.c +++ b/siteuser.c @@ -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); } diff --git a/smartfilter.c b/smartfilter.c index 7b9a9da..104a372 100644 --- a/smartfilter.c +++ b/smartfilter.c @@ -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("\n\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("\n\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("\n\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); } } diff --git a/splitlog.c b/splitlog.c index b55c721..5c82983 100644 --- a/splitlog.c +++ b/splitlog.c @@ -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\n\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); } diff --git a/totday.c b/totday.c index e599811..a02a1e5 100644 --- 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 2f0de54..ca2318c 100644 --- 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); } diff --git a/useragent.c b/useragent.c index 77a9acf..c100f84 100644 --- a/useragent.c +++ b/useragent.c @@ -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); } diff --git a/userinfo.c b/userinfo.c index 89be0dd..e87db5e 100644 --- a/userinfo.c +++ b/userinfo.c @@ -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); } diff --git a/usertab.c b/usertab.c index f943685..5e6aa82 100644 --- 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 dcfdc7d..71c6f3f 100644 --- 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)) {