From: Agnès Lièvre Date: Thu, 19 Jan 2006 18:05:42 +0000 (+0000) Subject: Gnuplot problem appeared... X-Git-Tag: imach-099s7~542 X-Git-Url: https://henry.ined.fr/git/?a=commitdiff_plain;h=9ef0a8bda1d78bdfbeec4488c2346a9a861f5faf;p=.git Gnuplot problem appeared... To be fixed --- diff --git a/src/imach.c b/src/imach.c index ab782ae..8be948e 100644 --- a/src/imach.c +++ b/src/imach.c @@ -1,6 +1,9 @@ /* $Id$ $State$ $Log$ + Revision 1.107 2006/01/19 16:20:37 brouard + Test existence of gnuplot in imach path + Revision 1.106 2006/01/19 13:24:36 brouard Some cleaning and links added in html output @@ -240,11 +243,11 @@ extern int errno; /* #define _(String) gettext (String) */ #define MAXLINE 256 + #define GNUPLOTPROGRAM "gnuplot" /*#define GNUPLOTPROGRAM "..\\gp37mgw\\wgnuplot"*/ #define FILENAMELENGTH 132 -/*#define DEBUG*/ -/*#define windows*/ + #define GLOCK_ERROR_NOPATH -1 /* empty path */ #define GLOCK_ERROR_GETCWD -2 /* cannot get cwd */ @@ -4661,8 +4664,7 @@ int main(int argc, char *argv[]) } } else if(s[m][i] !=9){ /* Standard case, age in fractional - years but with the precision of a - month */ + years but with the precision of a month */ agev[m][i]=(mint[m][i]/12.+1./24.+anint[m][i])-(moisnais[i]/12.+1./24.+annais[i]); if((int)mint[m][i]==99 || (int)anint[m][i]==9999) agev[m][i]=1; @@ -5547,23 +5549,34 @@ lsurv=vector(1,AGESUP); chdir(path); #ifndef UNIX - strcpy(plotcmd,"\""); + /* strcpy(plotcmd,"\""); */ #endif - strcat(plotcmd,pathimach); + strcpy(plotcmd,pathimach); /*strcat(plotcmd,CHARSEPARATOR);*/ strcat(plotcmd,GNUPLOTPROGRAM); #ifndef UNIX - strcat(plotcmd,"\""); + strcat(plotcmd,".exe"); + /* strcat(plotcmd,"\"");*/ #endif if(stat(plotcmd,&info)){ printf("Error gnuplot program not found: %s\n",plotcmd);fflush(stdout); } + +#ifndef UNIX + strcpy(plotcmd,"\""); +#endif + strcat(plotcmd,pathimach); + strcat(plotcmd,GNUPLOTPROGRAM); +#ifndef UNIX + strcat(plotcmd,".exe"); + strcat(plotcmd,"\""); +#endif strcat(plotcmd," "); strcat(plotcmd,optionfilegnuplot); printf("Starting graphs with: %s",plotcmd);fflush(stdout); if((outcmd=system(plotcmd)) != 0){ - printf(" Problem with gnuplot\n"); + printf("\n Problem with gnuplot\n"); } printf(" Wait..."); while (z[0] != 'q') {