]> henry.ined.fr Git - .git/commitdiff
Summary: open browser, use gnuplot on same dir than imach if not found in the path
authorN. Brouard <brouard@ined.fr>
Wed, 18 Jun 2014 17:54:09 +0000 (17:54 +0000)
committerN. Brouard <brouard@ined.fr>
Wed, 18 Jun 2014 17:54:09 +0000 (17:54 +0000)
src/imach.c

index cc37d162d1d7aee2d54549da8253e58525b357ef..79a21b8e9d20c125ee05e3f3e4dd52e311defdb3 100644 (file)
@@ -1,6 +1,9 @@
 /* $Id$
   $State$
   $Log$
+  Revision 1.151  2014/06/18 16:43:30  brouard
+  *** empty log message ***
+
   Revision 1.150  2014/06/18 16:42:35  brouard
   Summary: If gnuplot is not in the path try on same directory than imach binary (OSX)
   Author: brouard
@@ -6669,7 +6672,7 @@ Interval (in months) between two waves: Min=%d Max=%d Mean=%.2lf<br>\n",\
   if((outcmd=system(plotcmd)) != 0){
     printf("\n Problem with gnuplot command %s\n", plotcmd);
     printf("\n Trying on same directory\n");
-    sprintf(plotcmd,"./gnuplot %s", optionfilegnuplot);
+    sprintf(plotcmd,"%sgnuplot %s", pathimach, optionfilegnuplot);
     if((outcmd=system(plotcmd)) != 0)
       printf("\n Still a problem with gnuplot command %s\n", plotcmd);
   }
@@ -6680,8 +6683,13 @@ Interval (in months) between two waves: Min=%d Max=%d Mean=%.2lf<br>\n",\
     scanf("%s",z);
 /*     if (z[0] == 'c') system("./imach"); */
     if (z[0] == 'e') {
-      printf("Starting browser with: %s",optionfilehtm);fflush(stdout);
-      system(optionfilehtm);
+#ifdef OSX
+      sprintf(pplotcmd, "open %s", optionfilehtm);
+#elsedef
+      sprintf(pplotcmd, "%s", optionfilehtm);
+#enddef
+      printf("Starting browser with: %s",plotcmd);fflush(stdout);
+      system(plotcmd);
     }
     else if (z[0] == 'g') system(plotcmd);
     else if (z[0] == 'q') exit(0);