arqlen=strlen(arq);
if(arqlen>3 && strcmp(arq+arqlen-3,".gz") == 0) {
debuga("%s: %s > %s/sarg/sarg-file.in (zcat)",text[62],arq,tmp);
- if (snprintf(cmd,sizeof(cmd),"zcat '%s' > '%s/sarg/sarg-file.in'",arq,tmp)>=sizeof(cmd)) {
+ if (snprintf(cmd,sizeof(cmd),"zcat \"%s\" > \"%s/sarg/sarg-file.in\"",arq,tmp)>=sizeof(cmd)) {
fprintf(stderr,"SARG: decompression command too long for log file %s\n",arq);
exit(1);
}
if(arqlen>4 && strcmp(arq+arqlen-4,".bz2") == 0) {
debuga("%s: %s > %s/sarg/sarg-file.in (bzcat)",text[62],arq,tmp);
- if (snprintf(cmd,sizeof(cmd),"bzcat '%s' > '%s/sarg/sarg-file.in'",arq,tmp)>=sizeof(cmd)) {
+ if (snprintf(cmd,sizeof(cmd),"bzcat \"%s\" > \"%s/sarg/sarg-file.in\"",arq,tmp)>=sizeof(cmd)) {
fprintf(stderr,"SARG: decompression command too long for log file %s\n",arq);
exit(1);
}
if(arqlen>2 && strcmp(arq+arqlen-2,".Z") == 0) {
debuga("%s: %s (uncompress)",text[62],arq);
- if (snprintf(cmd,sizeof(cmd),"zcat '%s' > '%s/sarg/sarg-file.in'",arq,tmp)>=sizeof(cmd)) {
+ if (snprintf(cmd,sizeof(cmd),"zcat \"%s\" > \"%s/sarg/sarg-file.in\"",arq,tmp)>=sizeof(cmd)) {
fprintf(stderr,"SARG: decompression command too long for log file %s\n",arq);
exit(1);
}
debuga("%s: %s",text[63],arq);
- if (snprintf(cmd,sizeof(cmd),"%s '%s'",zip,arq)>=sizeof(cmd)) {
+ if (snprintf(cmd,sizeof(cmd),"%s \"%s\"",zip,arq)>=sizeof(cmd)) {
fprintf(stderr,"SARG: compression command too long for log file %s\n",arq);
exit(1);
}
while(fgets(buf,sizeof(buf),fp_top3)!=NULL)
printf("%s",buf);
} else {
- sprintf(buf,"'%s' -s 'SARG %s, %s' '%s' <'%s'",MailUtility,text[55],asctime(local),email,top3);
+ sprintf(buf,"\"%s\" -s \"SARG %s, %s\" \"%s\" <\"%s\"",MailUtility,text[55],asctime(local),email,top3);
cstatus=system(buf);
if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) {
fprintf(stderr, "SARG: command return status %d\n",WEXITSTATUS(cstatus));
debuga("%s: %s",text[54],tmp2);
}
- sprintf(csort,"sort -n -t '\\' -k 4,4 -k 3,3 -k 2,2 -k 1,1 -o \"%s\" \"%s\"",tmp2,tmp3);
+ sprintf(csort,"sort -n -t \"\\\" -k 4,4 -k 3,3 -k 2,2 -k 1,1 -o \"%s\" \"%s\"",tmp2,tmp3);
cstatus=system(csort);
if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) {
fprintf(stderr, "SARG: sort command return status %d\n",WEXITSTATUS(cstatus));