From b2dad7e7f164da64fa22bed209bc4c768f608e23 Mon Sep 17 00:00:00 2001 From: Frederic Marchal Date: Mon, 22 Dec 2014 13:59:25 +0100 Subject: [PATCH] Reduce the number of distinct messages to translate Replace some messages to have less variants of the same message. Be more consistent in the displayed messages strings. For instance, file names are displayed between quotes. --- authfail.c | 4 ++-- convlog.c | 2 +- dansguardian_log.c | 8 ++++---- dansguardian_report.c | 2 +- datafile.c | 4 ++-- decomp.c | 15 ++++++++------- denied.c | 4 ++-- download.c | 4 ++-- email.c | 2 +- exclude.c | 6 +++--- grepday.c | 10 +++++----- html.c | 8 ++++---- index.c | 4 ++-- ip2name.c | 2 +- log.c | 34 +++++++++++++++++++--------------- realtime.c | 6 +++--- redirector.c | 28 ++++++++++++++-------------- repday.c | 10 +++++----- report.c | 42 +++++++++++++++++++++--------------------- siteuser.c | 2 +- splitlog.c | 4 ++-- topsites.c | 6 +++--- topuser.c | 4 ++-- url.c | 4 ++-- useragent.c | 2 +- usertab.c | 2 +- util.c | 14 ++++++-------- 27 files changed, 118 insertions(+), 115 deletions(-) diff --git a/authfail.c b/authfail.c index 9d14ef0..c429407 100644 --- a/authfail.c +++ b/authfail.c @@ -114,7 +114,7 @@ void authfail_report(void) fprintf(fp_ou,"%s%s%s%s\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE")); if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),authfail_in); + debuga(_("Not enough memory to read file \"%s\"\n"),authfail_in); exit(EXIT_FAILURE); } @@ -202,7 +202,7 @@ void authfail_report(void) fputs("\n",fp_ou); if (write_html_trailer(fp_ou)<0) - debuga(_("Write error in file %s\n"),report); + debuga(_("Write error in file \"%s\"\n"),report); if (fclose(fp_ou)==EOF) debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno)); diff --git a/convlog.c b/convlog.c index e05204a..cb77aea 100644 --- a/convlog.c +++ b/convlog.c @@ -50,7 +50,7 @@ void convlog(const char *arq, char *df, int dfrom, int duntil) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the log file %s\n"),arq); + debuga(_("Not enough memory to read file \"%s\"\n"),arq); exit(EXIT_FAILURE); } diff --git a/dansguardian_log.c b/dansguardian_log.c index d3786d1..9dc60fc 100644 --- a/dansguardian_log.c +++ b/dansguardian_log.c @@ -97,19 +97,19 @@ void dansguardian_log(void) getword_start(&gwarea,buf); if (getword_atoi(&year,&gwarea,'.')<0 || getword_atoi(&mon,&gwarea,'.')<0 || getword_atoi(&day,&gwarea,' ')<0) { - debuga(_("Invalid date found in your dansguardian log file %s\n"),loglocation); + debuga(_("Invalid date in file \"%s\"\n"),loglocation); exit(EXIT_FAILURE); } if (getword_atoi(&hour,&gwarea,':')<0 || getword(minsec,sizeof(minsec),&gwarea,' ')<0) { - debuga(_("Invalid time found in your dansguardian log file %s\n"),loglocation); + debuga(_("Invalid time found in file \"%s\"\n"),loglocation); exit(EXIT_FAILURE); } if (getword(user,sizeof(user),&gwarea,' ')<0) { - debuga(_("Invalid user found in your dansguardian log file %s\n"),loglocation); + debuga(_("Invalid user found in file \"%s\"\n"),loglocation); exit(EXIT_FAILURE); } if (getword(ip,sizeof(ip),&gwarea,' ')<0) { - debuga(_("Invalid IP address found in your dansguardian log file %s\n"),loglocation); + debuga(_("Invalid IP address in file \"%s\"\n"),loglocation); exit(EXIT_FAILURE); } if (getword_skip(MAXLEN,&gwarea,'/')<0 || getword_skip(MAXLEN,&gwarea,'/')<0) { diff --git a/dansguardian_report.c b/dansguardian_report.c index e8a62d2..07d8823 100644 --- a/dansguardian_report.c +++ b/dansguardian_report.c @@ -166,7 +166,7 @@ void dansguardian_report(void) fputs("\n",fp_ou); if (write_html_trailer(fp_ou)<0) - debuga(_("Write error in file %s\n"),report); + debuga(_("Write error in file \"%s\"\n"),report); if (fclose(fp_ou)==EOF) debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno)); diff --git a/datafile.c b/datafile.c index 6d20b43..a72b59e 100644 --- a/datafile.c +++ b/datafile.c @@ -94,7 +94,7 @@ void data_file(char *tmp) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the downloaded files.\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),tmp3); exit(EXIT_FAILURE); } @@ -195,7 +195,7 @@ void data_file(char *tmp) if (fp_ou) fclose(fp_ou); if(debug) - debuga(_("Datafile %s written successfully\n"),DataFile); + debuga(_("Datafile \"%s\" written successfully\n"),DataFile); } void saverecs(FILE *fp_ou, const struct userinfostruct *uinfo, long long int nacc, char *url, long long int nbytes, char *ip, char *hora, char *dia, long long int nelap, long long int incache, long long int oucache) diff --git a/decomp.c b/decomp.c index e9c3b30..dbdddac 100644 --- a/decomp.c +++ b/decomp.c @@ -33,15 +33,16 @@ FILE *decomp(const char *arq, bool *pipe) int arqlen; if(access(arq, R_OK) != 0) { - debuga(_("File not found: %s\n"),arq); + debuga(_("File \"%s\" not found\n"),arq); exit(EXIT_FAILURE); } 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 decompression program such as zcat or bzcat */ + 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); + debuga(_("Decompression command too long for log file \"%s\"\n"),arq); exit(EXIT_FAILURE); } *pipe=true; @@ -49,9 +50,9 @@ FILE *decomp(const char *arq, bool *pipe) } 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); + debuga(_("Decompression command too long for log file \"%s\"\n"),arq); exit(EXIT_FAILURE); } *pipe=true; @@ -59,9 +60,9 @@ FILE *decomp(const char *arq, bool *pipe) } 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); + debuga(_("Decompression command too long for log file \"%s\"\n"),arq); exit(EXIT_FAILURE); } *pipe=true; diff --git a/denied.c b/denied.c index 40fabad..a7daecc 100644 --- a/denied.c +++ b/denied.c @@ -93,7 +93,7 @@ void gen_denied_report(void) fprintf(fp_ou,"%s%s%s%s\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE")); if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the denied accesses\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),denied_in); exit(EXIT_FAILURE); } @@ -173,7 +173,7 @@ void gen_denied_report(void) fputs("\n",fp_ou); if (write_html_trailer(fp_ou)<0) - debuga(_("Write error in file %s\n"),report); + debuga(_("Write error in file \"%s\"\n"),report); if (fclose(fp_ou)==EOF) debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno)); diff --git a/download.c b/download.c index 3987b50..335c62d 100644 --- a/download.c +++ b/download.c @@ -150,7 +150,7 @@ void download_report(void) fprintf(fp_ou,"%s%s%s%s\n",_("USERID"),_("IP/NAME"),_("DATE/TIME"),_("ACCESSED SITE")); if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the downloaded files\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),report_in); exit(EXIT_FAILURE); } @@ -226,7 +226,7 @@ void download_report(void) fputs("\n",fp_ou); if (write_html_trailer(fp_ou)<0) - debuga(_("Write error in file %s\n"),report); + debuga(_("Write error in file \"%s\"\n"),report); if (fclose(fp_ou)==EOF) debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno)); diff --git a/email.c b/email.c index ea50806..ec54008 100644 --- a/email.c +++ b/email.c @@ -78,7 +78,7 @@ int geramail(const char *dirname, int debug, const char *outdir, const char *ema totuser=0; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),wger); + debuga(_("Not enough memory to read file \"%s\"\n"),wger); exit(EXIT_FAILURE); } diff --git a/exclude.c b/exclude.c index d1cb038..3e7cebd 100644 --- a/exclude.c +++ b/exclude.c @@ -319,12 +319,12 @@ void getuexclude(const char *uexfile, int debug) } if (fseek(fp_ex, 0, SEEK_END)==-1) { - debuga(_("Failed to move till the end of the excluded users file %s: %s\n"),uexfile,strerror(errno)); + debuga(_("Failed to move till the end of file \"%s\": %s\n"),uexfile,strerror(errno)); exit(EXIT_FAILURE); } nreg = ftell(fp_ex); if (nreg<0) { - debuga(_("Cannot get the size of file %s\n"),uexfile); + debuga(_("Cannot get the size of file \"%s\": %s\n"),uexfile,strerror(errno)); exit(EXIT_FAILURE); } nreg += 11; @@ -334,7 +334,7 @@ void getuexclude(const char *uexfile, int debug) } if((excludeuser=(char *) malloc(nreg))==NULL){ - debuga(_("malloc error (%ld bytes required)\n"),nreg); + debuga(_("malloc failed to allocate %ld bytes\n"),nreg); exit(EXIT_FAILURE); } diff --git a/grepday.c b/grepday.c index c9ed6e5..efe6302 100644 --- a/grepday.c +++ b/grepday.c @@ -705,25 +705,25 @@ void greport_day(const struct userinfostruct *uinfo) fixendofline(buf); getword_start(&gwarea,buf); if (getword_atoll(&llday,&gwarea,'/')<0) { - debuga(_("Invalid date in file %s\n"),wdirname); + debuga(_("Invalid date in file \"%s\"\n"),wdirname); exit(EXIT_FAILURE); } day=(int)llday; if (day<1 || day>31) continue; if (getword_skip(20,&gwarea,'\t')<0 || getword_skip(20,&gwarea,'\t')<0) { - debuga(_("Invalid entry in file %s\n"),wdirname); + debuga(_("Invalid entry in file \"%s\"\n"),wdirname); exit(EXIT_FAILURE); } if ((datetimeby & DATETIME_BYTE)!=0) { if (getword_atoll(&bytes,&gwarea,'\t')<0) { - debuga(_("Invalid number of bytes in file %s\n"),wdirname); + debuga(_("Invalid number of bytes in file \"%s\"\n"),wdirname); exit(EXIT_FAILURE); } bytespoints[day-1]+=bytes; } if ((datetimeby & DATETIME_ELAP)!=0) { if (getword_atoll(&elap,&gwarea,'\0')<0) { - debuga(_("Invalid elapsed time in file %s\n"),wdirname); + debuga(_("Invalid elapsed time in file \"%s\"\n"),wdirname); exit(EXIT_FAILURE); } elappoints[day-1]+=elap; @@ -775,7 +775,7 @@ void greport_day(const struct userinfostruct *uinfo) fputs("\n",fp_ou); if (write_html_trailer(fp_ou)<0) - debuga(_("Write error in file %s\n"),wdirname); + debuga(_("Write error in file \"%s\"\n"),wdirname); if (fclose(fp_ou)==EOF) debuga(_("Failed to close file \"%s\": %s\n"),wdirname,strerror(errno)); #endif //HAVE_GD diff --git a/html.c b/html.c index ed6aba9..0080b0f 100644 --- a/html.c +++ b/html.c @@ -95,7 +95,7 @@ void htmlrel(void) if (access(warea, R_OK) != 0) { if (mkdir(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); } } @@ -125,7 +125,7 @@ void htmlrel(void) have_denied_report=true; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),arqin); + debuga(_("Not enough memory to read file \"%s\"\n"),arqin); exit(EXIT_FAILURE); } @@ -219,7 +219,7 @@ void htmlrel(void) fputs("\n",fp_ou); if(debug) { - debuga(_("Making report: %s\n"),uinfo->id); + debuga(_("Making report %s\n"),uinfo->id); } count=0; arqip[0]='\0'; @@ -408,7 +408,7 @@ void htmlrel(void) olduserip[0]='\0'; if ((line1=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),arqip); + debuga(_("Not enough memory to read file \"%s\"\n"),arqip); exit(EXIT_FAILURE); } while((buf=longline_read(fp_ip,line1))!=NULL) { diff --git a/index.c b/index.c index 04275c3..e9c83a3 100644 --- a/index.c +++ b/index.c @@ -558,7 +558,7 @@ static void file_index_to_date_index(const char *entry) sprintf(olddir,"%s%s",outdir,entry); if (rename(olddir,newdir)) { - debugapos("index",_("Error renaming \"%s\" into \"%s\": %s\n"),olddir,newdir,strerror(errno)); + debugapos("index",_("Failed to rename \"%s\" into \"%s\": %s\n"),olddir,newdir,strerror(errno)); exit(EXIT_FAILURE); } @@ -660,7 +660,7 @@ static void date_index_to_file_index(const char *entry) else continue; sprintf(olddir,"%s%04d/%s/%s",outdir,y1,direntp2->d_name,direntp3->d_name); if(rename(olddir,newdir)) { - debugapos("index",_("Error renaming \"%s\" into \"%s\": %s\n"),olddir,newdir,strerror(errno)); + debugapos("index",_("Failed to rename \"%s\" into \"%s\": %s\n"),olddir,newdir,strerror(errno)); exit(EXIT_FAILURE); } } diff --git a/ip2name.c b/ip2name.c index a2cf6f1..32720c0 100644 --- a/ip2name.c +++ b/ip2name.c @@ -276,7 +276,7 @@ void name2ip(char *name,int name_size) error=getaddrinfo(addr,NULL,NULL,&res); if (error) { freeaddrinfo(res); - debuga(_("Cannot resolve host name %s: %s\n"),name,gai_strerror(error)); + debuga(_("Cannot resolve host name \"%s\": %s\n"),name,gai_strerror(error)); exit(EXIT_FAILURE); } if (res->ai_family==AF_INET) { diff --git a/log.c b/log.c index 3d12704..c4d2456 100644 --- a/log.c +++ b/log.c @@ -548,7 +548,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); } @@ -740,11 +740,11 @@ int main(int argc,char *argv[]) printf(_(" Debug messages (-x) = %s\n"),(debug) ? _("Yes") : _("No")); printf(_(" Process messages (-z) = %s\n"),(debugz) ? _("Yes") : _("No")); printf(_(" Previous reports to keep (--lastlog) = %d\n"),LastLog); - printf(_("sarg version: %s\n"),VERSION); + printf(_("SARG version: %s\n"),VERSION); } if(debug) - debuga(_("sarg version: %s\n"),VERSION); + debuga(_("SARG version: %s\n"),VERSION); #ifdef ENABLE_DOUBLE_CHECK_DATA debuga(_("Sarg compiled to report warnings if the output is inconsistent\n")); @@ -777,7 +777,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) @@ -866,7 +866,7 @@ int main(int argc,char *argv[]) } } rewind(fp_in); - printf(_("SARG: Records in file: %lu, reading: %3.2f%%"),recs1,(float) 0); + printf(_("SARG: Records in file: %lu, reading: %3.2lf%%"),recs1,0.); putchar('\r'); fflush( stdout ) ; } @@ -1040,7 +1040,7 @@ int main(int argc,char *argv[]) computedate(iyear,imonth,iday,&tt); if (sscanf(hora,"%d:%d:%d",&tt.tm_hour,&tt.tm_min,&tt.tm_sec)!=3 || tt.tm_hour<0 || tt.tm_hour>=24 || tt.tm_min<0 || tt.tm_min>=60 || tt.tm_sec<0 || tt.tm_sec>=60) { - debuga(_("Invalid time found in %s\n"),arq); + debuga(_("Invalid time found in file \"%s\"\n"),arq); exit(EXIT_FAILURE); } t=&tt; @@ -1151,7 +1151,7 @@ int main(int argc,char *argv[]) computedate(iyear,imonth,iday,&tt); if (sscanf(hora,"%d:%d:%d",&tt.tm_hour,&tt.tm_min,&tt.tm_sec)!=3 || tt.tm_hour<0 || tt.tm_hour>=24 || tt.tm_min<0 || tt.tm_min>=60 || tt.tm_sec<0 || tt.tm_sec>=60) { - debuga(_("Invalid time found in %s\n"),arq); + debuga(_("Invalid time found in file \"%s\"\n"),arq); exit(EXIT_FAILURE); } t=&tt; @@ -1268,7 +1268,7 @@ int main(int argc,char *argv[]) if (isa_cols[ISACOL_Time]>=0) { if (sscanf(hora,"%d:%d:%d",&tt.tm_hour,&tt.tm_min,&tt.tm_sec)!=3 || tt.tm_hour<0 || tt.tm_hour>=24 || tt.tm_min<0 || tt.tm_min>=60 || tt.tm_sec<0 || tt.tm_sec>=60) { - debuga(_("Invalid time found in %s\n"),arq); + debuga(_("Invalid time found in file \"%s\"\n"),arq); exit(EXIT_FAILURE); } } @@ -1459,7 +1459,7 @@ int main(int argc,char *argv[]) if (!ufile) { ufile=malloc(sizeof(*ufile)); if (!ufile) { - debuga(_("Not enough memory to store the user %s\n"),user); + debuga(_("Not enough memory to store user %s\n"),user); exit(EXIT_FAILURE); } memset(ufile,0,sizeof(*ufile)); @@ -1573,8 +1573,10 @@ int main(int argc,char *argv[]) pclose(fp_in); else { fclose(fp_in); - if( ShowReadStatistics ) - printf(_("SARG: Records in file: %lu, reading: %3.2f%%\n"),recs1, (float) 100 ); + if( ShowReadStatistics ) { + printf(_("SARG: Records in file: %lu, reading: %3.2lf%%"),recs1,100.); + putchar('\n'); + } } } } @@ -1648,8 +1650,10 @@ int main(int argc,char *argv[]) debugaz(_("period=%s\n"),period.text); } - if(debug) - debuga(_("Period: %s\n"),period.text); + if(debug) { + debuga(_("Period: %s"),period.text); + putchar('\n'); + } if(fp_denied) fclose(fp_denied); @@ -1776,7 +1780,7 @@ static void getusers(const char *pwdfile, int debug) } if (fseek(fp_usr, 0, SEEK_END)==-1) { - debuga(_("Failed to move till the end of the users file \"%s\": %s\n"),pwdfile,strerror(errno)); + debuga(_("Failed to move till the end of file \"%s\": %s\n"),pwdfile,strerror(errno)); exit(EXIT_FAILURE); } nreg = ftell(fp_usr); @@ -1791,7 +1795,7 @@ static void getusers(const char *pwdfile, int debug) } if((userfile=(char *) malloc(nreg))==NULL){ - debuga(_("malloc error (%ld)\n"),nreg); + debuga(_("malloc failed to allocate %ld bytes\n"),nreg); exit(EXIT_FAILURE); } diff --git a/realtime.c b/realtime.c index b517cad..44d5d9f 100755 --- a/realtime.c +++ b/realtime.c @@ -80,7 +80,7 @@ static void getlog(void) sprintf(cmd,"tail -%d \"%s\"",realtime_access_log_lines,AccessLog[0]); fp = popen(cmd, "r"); if (!fp) { - debuga(_("Failed to get the %d trailing lines of %s: %s\n"),realtime_access_log_lines,AccessLog[0],strerror(errno)); + debuga(_("Failed to get the %d trailing lines of \"%s\": %s\n"),realtime_access_log_lines,AccessLog[0],strerror(errno)); debuga(_("Failed \"tail\" command: %s\n"),cmd); exit(EXIT_FAILURE); } @@ -233,11 +233,11 @@ static void datashow(const char *tmp) exit(EXIT_FAILURE); } if (getword(ip,sizeof(ip),&gwarea,'\t')<0) { - debuga(_("Invalid IP address in file %s\n"),tmp); + debuga(_("Invalid IP address in file \"%s\"\n"),tmp); exit(EXIT_FAILURE); } if (getword(user,sizeof(user),&gwarea,'\t')<0) { - debuga(_("Invalid user name in file %s\n"),tmp); + debuga(_("Invalid user found in file \"%s\"\n"),tmp); exit(EXIT_FAILURE); } if (strlen(user) < 1) continue; diff --git a/redirector.c b/redirector.c index 20af396..fb11420 100644 --- a/redirector.c +++ b/redirector.c @@ -80,7 +80,7 @@ static void parse_log(FILE *fp_ou,char *buf) } if(strcmp(leks,"end") != 0) { if (getword_limit(res,sizeof(res),&gwarea,sep[0])<0) { - debuga(_("Parsing of tag \"%s\" in redirector log %s returned no result\n"),leks,wentp); + debuga(_("Parsing of tag \"%s\" in redirector log \"%s\" returned no result\n"),leks,wentp); RedirectorErrors++; return; } @@ -137,7 +137,7 @@ static void parse_log(FILE *fp_ou,char *buf) } else { if (getword_atoll(&lyear,&gwarea,'-')<0 || getword_atoll(&lmon,&gwarea,'-')<0 || getword_atoll(&lday,&gwarea,' ')<0) { - debuga(_("Invalid date found in file %s\n"),wentp); + debuga(_("Invalid date in file \"%s\"\n"),wentp); RedirectorErrors++; return; } @@ -145,7 +145,7 @@ static void parse_log(FILE *fp_ou,char *buf) mon=(int)lmon; day=(int)lday; if (getword(hour,sizeof(hour),&gwarea,' ')<0) { - debuga(_("Invalid time found in file %s\n"),wentp); + debuga(_("Invalid time found in file \"%s\"\n"),wentp); RedirectorErrors++; return; } @@ -155,22 +155,22 @@ static void parse_log(FILE *fp_ou,char *buf) return; } if (getword(list,sizeof(list),&gwarea,'/')<0) { - debuga(_("Invalid redirected list in file %s\n"),wentp); + debuga(_("Invalid redirected list in file \"%s\"\n"),wentp); RedirectorErrors++; return; } if (getword_skip(MAXLEN,&gwarea,' ')<0 || getword_limit(full_url,sizeof(full_url),&gwarea,' ')<0) { - debuga(_("Invalid URL in file %s\n"),wentp); + debuga(_("Invalid URL in file \"%s\"\n"),wentp); RedirectorErrors++; return; } if (getword(ip,sizeof(ip),&gwarea,'/')<0) { - debuga(_("Invalid source IP in file %s\n"),wentp); + debuga(_("Invalid source IP in file \"%s\"\n"),wentp); RedirectorErrors++; return; } if (getword_skip(MAXLEN,&gwarea,' ')<0 || getword(user,sizeof(user),&gwarea,' ')<0) { - debuga(_("Invalid user in file %s\n"),wentp); + debuga(_("Invalid user found in file \"%s\"\n"),wentp); RedirectorErrors++; return; } @@ -269,7 +269,7 @@ static void read_log(const char *wentp, FILE *fp_ou,int dfrom,int duntil) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the redirector log\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),wentp); exit(EXIT_FAILURE); } @@ -462,7 +462,7 @@ void redirector_report(void) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the processed redirector log\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),redirector_sorted); exit(EXIT_FAILURE); } @@ -479,19 +479,19 @@ void redirector_report(void) while((buf=longline_read(fp_in,line))!=NULL) { getword_start(&gwarea,buf); if (getword(user,sizeof(user),&gwarea,'\t')<0) { - debuga(_("Invalid user in file %s\n"),redirector_sorted); + debuga(_("Invalid user found in file \"%s\"\n"),redirector_sorted); exit(EXIT_FAILURE); } if (getword_atoll(&data2,&gwarea,'\t')<0) { - debuga(_("Invalid date in file %s\n"),redirector_sorted); + debuga(_("Invalid date in file \"%s\"\n"),redirector_sorted); exit(EXIT_FAILURE); } if (getword(hora,sizeof(hora),&gwarea,'\t')<0) { - debuga(_("Invalid time in file %s\n"),redirector_sorted); + debuga(_("Invalid time found in file \"%s\"\n"),redirector_sorted); exit(EXIT_FAILURE); } if (getword(ip,sizeof(ip),&gwarea,'\t')<0) { - debuga(_("Invalid IP address in file %s\n"),redirector_sorted); + debuga(_("Invalid IP address in file \"%s\"\n"),redirector_sorted); exit(EXIT_FAILURE); } if (getword_ptr(buf,&url,&gwarea,'\t')<0) { @@ -571,7 +571,7 @@ void redirector_report(void) fputs("\n",fp_ou); if (write_html_trailer(fp_ou)<0) - debuga(_("Write error in file %s\n"),report); + debuga(_("Write error in file \"%s\"\n"),report); if (fclose(fp_ou)==EOF) debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno)); diff --git a/repday.c b/repday.c index 0df0484..d78c625 100644 --- a/repday.c +++ b/repday.c @@ -78,7 +78,7 @@ void report_day(const struct userinfostruct *uinfo) fixendofline(buf); getword_start(&gwarea,buf); if (getword(data,sizeof(data),&gwarea,'\t')<0) { - debuga(_("Invalid date in file %s\n"),wdirname); + debuga(_("Invalid date in file \"%s\"\n"),wdirname); exit(EXIT_FAILURE); } if (sscanf(data,"%d/%d/%d",&day,&month,&year)!=3) continue; @@ -94,7 +94,7 @@ void report_day(const struct userinfostruct *uinfo) } if (getword_atoll(&hour,&gwarea,'\t')<0) { - debuga(_("Invalid time in file %s\n"),wdirname); + debuga(_("Invalid time found in file \"%s\"\n"),wdirname); exit(EXIT_FAILURE); } ihour=(int)hour; @@ -103,14 +103,14 @@ void report_day(const struct userinfostruct *uinfo) if ((datetimeby & DATETIME_BYTE)!=0) { colsep=((datetimeby & DATETIME_ELAP)!=0) ? '\t' : '\0'; if (getword_atoll(&bytes,&gwarea,colsep)<0) { - debuga(_("Invalid number of bytes in file %s\n"),wdirname); + debuga(_("Invalid number of bytes in file \"%s\"\n"),wdirname); exit(EXIT_FAILURE); } tbytes[i]+=bytes; } if ((datetimeby & DATETIME_ELAP)!=0) { if (getword_atoll(&elap,&gwarea,'\0')<0) { - debuga(_("Invalid elapsed time in file %s\n"),wdirname); + debuga(_("Invalid elapsed time in file \"%s\"\n"),wdirname); exit(EXIT_FAILURE); } telap[i]+=elap; @@ -242,7 +242,7 @@ void report_day(const struct userinfostruct *uinfo) } if (write_html_trailer(fp_ou)<0) - debuga(_("Write error in file %s\n"),arqout); + debuga(_("Write error in file \"%s\"\n"),arqout); if (fclose(fp_ou)==EOF) debuga(_("Failed to close file \"%s\": %s\n"),arqout,strerror(errno)); return; diff --git a/report.c b/report.c index 7e70358..8fb260d 100644 --- a/report.c +++ b/report.c @@ -90,7 +90,7 @@ void gerarel(void) } if(debugz){ - debugaz(_("outdirname=%s\n"),outdirname); + debugaz(_("Report output directory name=%s\n"),outdirname); } if(UserAgentLog[0] != '\0' && email[0] == '\0') useragent(); @@ -153,7 +153,7 @@ void gerarel(void) oucache=0; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the downloaded files\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),tmp3); exit(EXIT_FAILURE); } @@ -417,7 +417,7 @@ static FILE *maketmp(const char *user, const char *dirname, int debug) if((ReportType & REPORT_TYPE_USERS_SITES) == 0) return(NULL); if((ReportType & REPORT_TYPE_TOPUSERS) == 0) return(NULL); - if(debug) debuga(_("Making file: %s/%s\n"),tmp,user); + if(debug) debuga(_("Making file %s/%s\n"),tmp,user); if (snprintf(wdirname,sizeof(wdirname),"%s/%s.utmp",tmp,user)>=sizeof(wdirname)) { debuga(_("Temporary file name too long: %s/%s.utmp\n"),tmp,user); exit(EXIT_FAILURE); @@ -488,7 +488,7 @@ static void gravager(FILE *fp_gen,const char *filename, const struct userinfostr to print a long long int unless it is exactly 64-bits long. */ if (fprintf(fp_gen,"%s\t%"PRIu64"\t%"PRIu64"\t%s\t%s\t%s\t%s\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",uinfo->id,(uint64_t)nacc,(uint64_t)nbytes,url,ip,hora,dia,(uint64_t)nelap,(uint64_t)incache,(uint64_t)oucache)<0) { - debuga(_("Failed to write a line in %s\n"),filename); + debuga(_("Failed to write a line in \"%s\"\n"),filename); exit(EXIT_FAILURE); } @@ -510,7 +510,7 @@ void totalger(FILE *fp_gen,const char *filename) to print a long long int unless it is exactly 64-bits long. */ if (fprintf(fp_gen,"TOTAL\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\t%"PRIu64"\n",(uint64_t)globstat.nacc,(uint64_t)globstat.nbytes,(uint64_t)globstat.elap,(uint64_t)globstat.incache,(uint64_t)globstat.oucache)<0) { - debuga(_("Failed to write the total line in %s\n"),filename); + debuga(_("Failed to write the total line in \"%s\"\n"),filename); exit(EXIT_FAILURE); } } @@ -536,7 +536,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) while (isdigit(*buffer)) number=(number * 10) + (*buffer++)-'0'; if (*buffer!='\t') { - debuga(_("Invalid total number of accesses in %s\n"),filename); + debuga(_("Invalid total number of accesses in \"%s\"\n"),filename); exit(EXIT_FAILURE); } buffer++; @@ -553,7 +553,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) while (isdigit(*buffer)) number=(number * 10) + (*buffer++)-'0'; if (*buffer!='\t') { - debuga(_("Invalid total size in %s\n"),filename); + debuga(_("Invalid total size in \"%s\"\n"),filename); exit(EXIT_FAILURE); } buffer++; @@ -570,7 +570,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) while (isdigit(*buffer)) number=(number * 10) + (*buffer++)-'0'; if (*buffer!='\t') { - debuga(_("Invalid total elapsed time in %s\n"),filename); + debuga(_("Invalid total elapsed time in \"%s\"\n"),filename); exit(EXIT_FAILURE); } buffer++; @@ -587,7 +587,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) while (isdigit(*buffer)) number=(number * 10) + (*buffer++)-'0'; if (*buffer!='\t') { - debuga(_("Invalid total cache hit in %s\n"),filename); + debuga(_("Invalid total cache hit in \"%s\"\n"),filename); exit(EXIT_FAILURE); } buffer++; @@ -604,7 +604,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) while (isdigit(*buffer)) number=(number * 10) + (*buffer++)-'0'; if (*buffer!='\0') { - debuga(_("Invalid total cache miss in %s\n"),filename); + debuga(_("Invalid total cache miss in \"%s\"\n"),filename); exit(EXIT_FAILURE); } item->oucache=number*sign; @@ -614,7 +614,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) item->user=buffer; for (i=0 ; i=' ' ; i++) buffer++; if (*buffer!='\t') { - debuga(_("User name too long or invalid in %s\n"),filename); + debuga(_("User name too long or invalid in \"%s\"\n"),filename); exit(EXIT_FAILURE); } *buffer++='\0'; @@ -630,7 +630,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) while (isdigit(*buffer)) number=(number * 10) + (*buffer++)-'0'; if (*buffer!='\t') { - debuga(_("Invalid number of accesses in %s\n"),filename); + debuga(_("Invalid number of accesses in \"%s\"\n"),filename); exit(EXIT_FAILURE); } buffer++; @@ -647,7 +647,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) while (isdigit(*buffer)) number=(number * 10) + (*buffer++)-'0'; if (*buffer!='\t') { - debuga(_("Invalid number of bytes in %s\n"),filename); + debuga(_("Invalid number of bytes in file \"%s\"\n"),filename); exit(EXIT_FAILURE); } buffer++; @@ -656,7 +656,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) item->url=buffer; while ((unsigned char)*buffer>=' ') buffer++; if (*buffer!='\t') { - debuga(_("URL too long or invalid in %s\n"),filename); + debuga(_("URL too long or invalid in \"%s\"\n"),filename); exit(EXIT_FAILURE); } *buffer++='\0'; @@ -664,7 +664,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) item->ip=buffer; for (i=0 ; i=' ' ; i++) buffer++; if (*buffer!='\t') { - debuga(_("IP address too long or invalid in %s\n"),filename); + debuga(_("IP address too long or invalid in \"%s\"\n"),filename); exit(EXIT_FAILURE); } *buffer++='\0'; @@ -672,7 +672,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) item->time=buffer; for (i=0 ; i=' ' ; i++) buffer++; if (*buffer!='\t') { - debuga(_("Time too long or invalid in %s\n"),filename); + debuga(_("Time too long or invalid in \"%s\"\n"),filename); exit(EXIT_FAILURE); } *buffer++='\0'; @@ -680,7 +680,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) item->date=buffer; for (i=0 ; i=' ' ; i++) buffer++; if (*buffer!='\t') { - debuga(_("Date too long or invalid in %s\n"),filename); + debuga(_("Date too long or invalid in \"%s\"\n"),filename); exit(EXIT_FAILURE); } *buffer++='\0'; @@ -696,7 +696,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) while (isdigit(*buffer)) number=(number * 10) + (*buffer++)-'0'; if (*buffer!='\t') { - debuga(_("Invalid elapsed time in %s\n"),filename); + debuga(_("Invalid elapsed time in file \"%s\"\n"),filename); exit(EXIT_FAILURE); } buffer++; @@ -713,7 +713,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) while (isdigit(*buffer)) number=(number * 10) + (*buffer++)-'0'; if (*buffer!='\t') { - debuga(_("Invalid cache hit size in %s\n"),filename); + debuga(_("Invalid cache hit size in \"%s\"\n"),filename); exit(EXIT_FAILURE); } buffer++; @@ -730,7 +730,7 @@ int ger_read(char *buffer,struct generalitemstruct *item,const char *filename) while (isdigit(*buffer)) number=(number * 10) + (*buffer++)-'0'; if (*buffer!='\0') { - debuga(_("Invalid cache miss size in %s\n"),filename); + debuga(_("Invalid cache miss size in \"%s\"\n"),filename); exit(EXIT_FAILURE); } item->oucache=number*sign; @@ -744,7 +744,7 @@ static void grava_SmartFilter(const char *dirname, const char *user, const char char wdirname[MAXLEN]; if (snprintf(wdirname,sizeof(wdirname),"%s/smartfilter.int_unsort",dirname)>=sizeof(wdirname)) { - debuga(_("File name too long for %s/smartfilter.int_unsort\n"),dirname); + debuga(_("File name too long: %s/smartfilter.int_unsort\n"),dirname); exit(EXIT_FAILURE); } diff --git a/siteuser.c b/siteuser.c index e4268f6..bd4d0a6 100644 --- a/siteuser.c +++ b/siteuser.c @@ -107,7 +107,7 @@ void siteuser(void) topuser_link=((ReportType & REPORT_TYPE_USERS_SITES) != 0 && !indexonly); if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),general2); + debuga(_("Not enough memory to read file \"%s\"\n"),general2); exit(EXIT_FAILURE); } diff --git a/splitlog.c b/splitlog.c index e1cfd33..7a30725 100644 --- a/splitlog.c +++ b/splitlog.c @@ -86,7 +86,7 @@ void splitlog(const char *arq, const char *df, int dfrom, int duntil, int conver } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the log file %s\n"),arq); + debuga(_("Not enough memory to read file \"%s\"\n"),arq); exit(EXIT_FAILURE); } time(&min_tt); @@ -94,7 +94,7 @@ void splitlog(const char *arq, const char *df, int dfrom, int duntil, int conver while((buf=longline_read(fp_in,line))!=NULL) { getword_start(&gwarea,buf); if (getword(data,sizeof(data),&gwarea,' ')<0) { - debuga(_("Invalid date found in file %s\n"),arq); + debuga(_("Invalid date in file \"%s\"\n"),arq); exit(EXIT_FAILURE); } tt=atoi(data); diff --git a/topsites.c b/topsites.c index de53468..1829bff 100644 --- a/topsites.c +++ b/topsites.c @@ -103,7 +103,7 @@ void topsites(void) } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),general2); + debuga(_("Not enough memory to read file \"%s\"\n"),general2); exit(EXIT_FAILURE); } @@ -261,7 +261,7 @@ void topsites(void) ntopsites = 0; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read file %s\n"),sites); + debuga(_("Not enough memory to read file \"%s\"\n"),sites); exit(EXIT_FAILURE); } @@ -316,7 +316,7 @@ void topsites(void) fputs("\n",fp_ou); if (write_html_trailer(fp_ou)<0) - debuga(_("Write error in file %s\n"),report); + debuga(_("Write error in file \"%s\"\n"),report); if (fclose(fp_ou)==EOF) debuga(_("Failed to close file \"%s\": %s\n"),report,strerror(errno)); diff --git a/topuser.c b/topuser.c index 977c3b1..3030096 100644 --- a/topuser.c +++ b/topuser.c @@ -98,7 +98,7 @@ void topuser(void) totuser=0; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the file %s\n"),wger); + debuga(_("Not enough memory to read file \"%s\"\n"),wger); exit(EXIT_FAILURE); } @@ -290,7 +290,7 @@ void topuser(void) ntopuser = 0; if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the downloaded files\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),top1); exit(EXIT_FAILURE); } diff --git a/url.c b/url.c index df86d22..f349ed3 100644 --- a/url.c +++ b/url.c @@ -580,12 +580,12 @@ 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); } if ((line=longline_create())==NULL) { - debuga(_("Not enough memory to read the host name aliases\n")); + debuga(_("Not enough memory to read file \"%s\"\n"),Filename); exit(EXIT_FAILURE); } diff --git a/useragent.c b/useragent.c index 4553c20..bb8c08c 100644 --- a/useragent.c +++ b/useragent.c @@ -329,7 +329,7 @@ void useragent(void) fputs("\n",fp_ht); if (write_html_trailer(fp_ht)<0) - debuga(_("Write error in file %s\n"),hfile); + debuga(_("Write error in file \"%s\"\n"),hfile); if (fclose(fp_ht)==EOF) debuga(_("Failed to close file \"%s\": %s\n"),hfile,strerror(errno)); diff --git a/usertab.c b/usertab.c index 8f9258f..a210e8a 100644 --- a/usertab.c +++ b/usertab.c @@ -65,7 +65,7 @@ static void init_file_usertab(const char *UserTabFile) exit(EXIT_FAILURE); } if (fseek(fp_usr, 0, SEEK_END)==-1) { - debuga(_("Failed to move till the end of the usertab file %s: %s\n"),UserTabFile,strerror(errno)); + debuga(_("Failed to move till the end of file \"%s\": %s\n"),UserTabFile,strerror(errno)); exit(EXIT_FAILURE); } nreg = ftell(fp_usr); diff --git a/util.c b/util.c index 8aec7ab..fa50221 100644 --- a/util.c +++ b/util.c @@ -342,7 +342,7 @@ void my_mkdir(const char *name) chars=0; for (i=0 ; name[i] ; i++) { if (i>=sizeof(w0)) { - debuga(_("directory name too long: %s\n"),name); + debuga(_("Directory name too long: %s\n"),name); exit(EXIT_FAILURE); } if (chars>0 && name[i] == '/') { @@ -787,9 +787,7 @@ void obttotal(const char *dirname, const char *name, int nuser, long long int *t } if ((line=longline_create())==NULL) { - /* TRANSLATORS: %s is a file name. - */ - debuga(_("Not enough memory to read \"%s\"\n"),wdir); + debuga(_("Not enough memory to read file \"%s\"\n"),wdir); exit(EXIT_FAILURE); } @@ -1136,7 +1134,7 @@ int vrfydir(const struct periodstruct *per1, const char *addr, const char *site, sprintf(wdir,"%s/sarg-date",outdirname); if ((fp_ou = fopen(wdir, "wt")) == 0) { - debuga(_("Cannot open \"%s\": %s\n"),wdir,strerror(errno)); + debuga(_("Cannot open file \"%s\": %s\n"),wdir,strerror(errno)); perror("SARG:"); exit(EXIT_FAILURE); } @@ -1150,7 +1148,7 @@ int vrfydir(const struct periodstruct *per1, const char *addr, const char *site, exit(EXIT_FAILURE); } if (fclose(fp_ou)==EOF) { - debuga(_("Failed to write the date in \"%s\": %s\n"),wdir,strerror(errno)); + debuga(_("Failed to close file \"%s\": %s\n"),wdir,strerror(errno)); perror("SARG:"); exit(EXIT_FAILURE); } @@ -1450,7 +1448,7 @@ void load_excludecodes(const char *ExcludeCodes) } if (fseek(fp_in, 0, SEEK_END)==-1) { - debuga(_("Failed to move till the end of the excluded codes file \"%s\": %s\n"),ExcludeCodes,strerror(errno)); + debuga(_("Failed to move till the end of file \"%s\": %s\n"),ExcludeCodes,strerror(errno)); exit(EXIT_FAILURE); } MemSize = ftell(fp_in); @@ -1830,7 +1828,7 @@ void url_to_file(const char *url,char *file,int filesize) void version(void) { - printf(_("SARG Version: %s\n"),VERSION); + printf(_("SARG version: %s\n"),VERSION); #if defined(ENABLE_NLS) && defined(HAVE_LOCALE_H) if (debug) { printf(_("\nFor the translation to work, a valid message file should be installed as " -- 2.47.2