[BACK]Return to shell.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan

Diff for /OpenXM/src/kan96xx/Kan/shell.c between version 1.7 and 1.9

version 1.7, 2003/12/04 06:29:21 version 1.9, 2003/12/13 13:29:44
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/kan96xx/Kan/shell.c,v 1.6 2003/12/04 05:29:12 takayama Exp $ */  /* $OpenXM: OpenXM/src/kan96xx/Kan/shell.c,v 1.8 2003/12/05 07:05:24 takayama Exp $ */
 #include <stdio.h>  #include <stdio.h>
 #include <sys/types.h>  #include <sys/types.h>
 #include <sys/stat.h>  #include <sys/stat.h>
Line 41  static int AfterPt=0;
Line 41  static int AfterPt=0;
 static char *AfterDeleteFile[MAXFILES];  static char *AfterDeleteFile[MAXFILES];
 static int AfterD=0;  static int AfterD=0;
   
 static int KeepTmpFiles = 1;  static int KeepTmpFiles = 0;
   
 extern int OX_P_stdin;  extern int OX_P_stdin;
 extern int OX_P_stdout;  extern int OX_P_stdout;
Line 420  int oxsFileToVar(char *v,char *fname) {
Line 420  int oxsFileToVar(char *v,char *fname) {
   int limit;    int limit;
   int c,i;    int c,i;
   
   if (v == NULL) errorKan1("%s\n","oxsFileToVar(), v is NULL.");    if (v == NULL) {
           /* errorKan1("%s\n","oxsFileToVar(), v is NULL."); */
           fprintf(stderr,"oxsFileToVar(), v is NULL.");
           return(-1);
     }
   limit = 1024;    limit = 1024;
   fp = fopen(fname,"r");    fp = fopen(fname,"r");
   if (fp == NULL) {    if (fp == NULL) {
     fprintf(stderr,"Filename=%s\n",fname);      fprintf(stderr,"Filename=%s\n",fname);
     errorKan1("%s\n","oxsFileToVar(), the file cannot be opened.");      /* errorKan1("%s\n","oxsFileToVar(), the file cannot be opened."); */
           fprintf(stderr,"oxsFileToVar(), the file cannot be opened.");
           return(-1);
   }    }
   s = (char *)mymalloc(limit);    s = (char *)mymalloc(limit);
   if (s == NULL) errorKan1("%s\n","No more memory in oxsFileToVar().");    if (s == NULL) errorKan1("%s\n","No more memory in oxsFileToVar().");
Line 533  static struct object oxsExecuteBlocked(struct object o
Line 539  static struct object oxsExecuteBlocked(struct object o
 {  {
   int r,i,n;    int r,i,n;
   char **argv;    char **argv;
     int errorf;
   
   argv = oxsBuildArgv(ob);    argv = oxsBuildArgv(ob);
   argv = oxsBuildArgvRedirect(argv);    argv = oxsBuildArgvRedirect(argv);
Line 545  static struct object oxsExecuteBlocked(struct object o
Line 552  static struct object oxsExecuteBlocked(struct object o
     errorKan1("%s\n","ForkExecBlocked failed.");      errorKan1("%s\n","ForkExecBlocked failed.");
   }    }
   */    */
     errorf=0;
   if (AfterPt > 0) {    if (AfterPt > 0) {
     for (i=0; i< AfterPt; i++) {      for (i=0; i< AfterPt; i++) {
       oxsFileToVar(AfterSetVar[i],AfterReadFile[i]);        if (oxsFileToVar(AfterSetVar[i],AfterReadFile[i]) != 0) {
           errorf=1;
         }
     }      }
   }    }
   AfterPt = 0;    AfterPt = 0;
Line 560  static struct object oxsExecuteBlocked(struct object o
Line 570  static struct object oxsExecuteBlocked(struct object o
     }      }
   }    }
   AfterD = 0;    AfterD = 0;
     if (errorf) errorKan1("%s\n","Some errors in oxsFileToVar().");
   
   return(KpoInteger(r));    return(KpoInteger(r));
 }  }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.9

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>