From: Frédéric Marchal Date: Thu, 1 Oct 2009 09:15:18 +0000 (+0000) Subject: Replace more single quotes by double quotes in external commands to be compatible... X-Git-Tag: v2_2_6~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb08bfe3c3b04ce30ded4768d9f8188a03871d13;p=thirdparty%2Fsarg.git Replace more single quotes by double quotes in external commands to be compatible with windows. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 46e40b8..1b39557 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ PROJECT(sarg C) SET(sarg_VERSION 2) SET(sarg_REVISION 2) SET(sarg_BUILD "6rc1") -SET(sarg_BUILDDATE "Sep-30-2009") +SET(sarg_BUILDDATE "Oct-01-2009") INCLUDE(AddFileDependencies) INCLUDE(CheckIncludeFile) diff --git a/decomp.c b/decomp.c index 3583e1c..2a3b206 100644 --- a/decomp.c +++ b/decomp.c @@ -40,7 +40,7 @@ void decomp(char *arq, char *zip, const char *tmp) 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); } @@ -57,7 +57,7 @@ void decomp(char *arq, char *zip, const char *tmp) 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); } @@ -74,7 +74,7 @@ void decomp(char *arq, char *zip, const char *tmp) 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); } @@ -109,7 +109,7 @@ void recomp(const char *arq, const char *zip) 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); } diff --git a/email.c b/email.c index c8d03f1..ecaf07c 100644 --- a/email.c +++ b/email.c @@ -335,7 +335,7 @@ int geramail(const char *dirname, int debug, const char *outdir, int userip, con 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)); diff --git a/include/info.h b/include/info.h index 2ae2dd8..5a29798 100755 --- a/include/info.h +++ b/include/info.h @@ -1,3 +1,3 @@ -#define VERSION PACKAGE_VERSION" Sep-30-2009" +#define VERSION PACKAGE_VERSION" Oct-01-2009" #define PGM PACKAGE_NAME #define URL "http://sarg.sourceforge.net" diff --git a/useragent.c b/useragent.c index dc5cc02..52d9458 100644 --- a/useragent.c +++ b/useragent.c @@ -120,7 +120,7 @@ void useragent(void) 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));