[BACK]Return to load.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / parse

Diff for /OpenXM_contrib2/asir2000/parse/load.c between version 1.11 and 1.15

version 1.11, 2004/03/02 08:28:49 version 1.15, 2005/03/24 12:46:45
Line 45 
Line 45 
  * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,   * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
  * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.   * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
  *   *
  * $OpenXM: OpenXM_contrib2/asir2000/parse/load.c,v 1.10 2004/03/02 07:44:02 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/parse/load.c,v 1.14 2004/03/18 01:59:41 noro Exp $
 */  */
 #include "ca.h"  #include "ca.h"
 #include "parse.h"  #include "parse.h"
Line 79 
Line 79 
 #define MALLOC(x) GC_malloc((x)+4)  #define MALLOC(x) GC_malloc((x)+4)
 #endif  #endif
   
 char *ASIRLOADPATH[32];  char **ASIRLOADPATH;
   
 #if defined(VISUAL)  #if defined(VISUAL)
 #define ENVDELIM ';'  #define ENVDELIM ';'
Line 111  char *search_executable(char *name)
Line 111  char *search_executable(char *name)
         struct stat buf;          struct stat buf;
   
         nlen = strlen(name);          nlen = strlen(name);
         for ( s = (char *)getenv("PATH"); *s; ) {          for ( s = (char *)getenv("PATH"); s; ) {
                 c = (char *)index(s,':');                  c = (char *)index(s,':');
                 len = c ? c-s : strlen(dir);                  len = c ? c-s : strlen(s);
                 if ( len >= BUFSIZ ) continue;                  if ( len >= BUFSIZ ) continue;
                 strncpy(dir,s,len); s = c+1; dir[len] = 0;                  strncpy(dir,s,len); dir[len] = 0;
                   if ( c ) s = c+1;
                   else s = 0;
                 if ( len+nlen+1 >= BUFSIZ ) continue;                  if ( len+nlen+1 >= BUFSIZ ) continue;
                 sprintf(path,"%s/%s",dir,name);                  sprintf(path,"%s/%s",dir,name);
                 if ( !stat(path,&buf) && !(buf.st_mode & S_IFDIR)                  if ( !stat(path,&buf) && !(buf.st_mode & S_IFDIR)
                         && !access(path,X_OK) ) {  #if !defined(VISUAL)
                           && !access(path,X_OK)
   #endif
                   ) {
                         len = strlen(path)+1;                          len = strlen(path)+1;
                         ret = (char *)MALLOC(len);                          ret = (char *)MALLOC(len);
                         strcpy(ret,path);                          strcpy(ret,path);
Line 169  void env_init() {
Line 174  void env_init() {
                         strcpy(asir_pager,MORE);                          strcpy(asir_pager,MORE);
                 }                  }
         }          }
         if ( e = getenv("ASIRLOADPATH" ) )          if ( e = getenv("ASIRLOADPATH" ) ) {
                 for ( i = 0; ; i++, e = p+1 ) {                  for ( i = 0; ; i++, e = p+1 ) {
                         p = (char *)index(e,ENVDELIM);                          p = (char *)index(e,ENVDELIM);
                           if ( !p )
                                   break;
                   }
                   i += 2;
           ASIRLOADPATH=(char **)MALLOC(sizeof(char *)*i);
                   for ( l = 0; l<i; l++) ASIRLOADPATH[l] = NULL;
                   e = getenv("ASIRLOADPATH");
                   for ( i = 0; ; i++, e = p+1 ) {
                           p = (char *)index(e,ENVDELIM);
                         l = p ? p-e : strlen(e); q = (char *)MALLOC(l+1);                          l = p ? p-e : strlen(e); q = (char *)MALLOC(l+1);
                         if ( l ) {                          if ( l ) {
                                 strncpy(q,e,l); q[l] = 0; ASIRLOADPATH[i] = q;                                  strncpy(q,e,l); q[l] = 0; ASIRLOADPATH[i] = q;
Line 179  void env_init() {
Line 193  void env_init() {
                         if ( !p )                          if ( !p )
                                 break;                                  break;
                 }                  }
       }
         for ( i = 0; ASIRLOADPATH[i]; i++ );          for ( i = 0; ASIRLOADPATH[i]; i++ );
         ASIRLOADPATH[i] = asir_libdir;          ASIRLOADPATH[i] = asir_libdir;
 }  }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.15

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