]> henry.ined.fr Git - .git/commitdiff
Gnuplot problem appeared...
authorAgnès Lièvre <agnes.lievre@education.gouv.fr>
Thu, 19 Jan 2006 18:05:42 +0000 (18:05 +0000)
committerAgnès Lièvre <agnes.lievre@education.gouv.fr>
Thu, 19 Jan 2006 18:05:42 +0000 (18:05 +0000)
To be fixed

src/imach.c

index ab782ae834a265627e450cc477b1de7bcf7ea13f..8be948e84e1a97251a7d677f446fe6e83913c05a 100644 (file)
@@ -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') {