[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.13 and 1.16

version 1.13, 2004/03/05 08:45:49 version 1.16, 2005/03/24 22:54:22
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.12 2004/03/05 08:34:43 noro Exp $   * $OpenXM: OpenXM_contrib2/asir2000/parse/load.c,v 1.15 2005/03/24 12:46:45 takayama 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 121  char *search_executable(char *name)
Line 121  char *search_executable(char *name)
                 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 171  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 += 3;
           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 181  void env_init() {
Line 193  void env_init() {
                         if ( !p )                          if ( !p )
                                 break;                                  break;
                 }                  }
       }else{
             ASIRLOADPATH=(char **)MALLOC(sizeof(char *)*3);
             ASIRLOADPATH[0] = NULL;
       }
         for ( i = 0; ASIRLOADPATH[i]; i++ );          for ( i = 0; ASIRLOADPATH[i]; i++ );
         ASIRLOADPATH[i] = asir_libdir;          ASIRLOADPATH[i++] = asir_libdir;
           ASIRLOADPATH[i] = NULL;
 }  }
   
 void searchasirpath(char *name,char **pathp)  void searchasirpath(char *name,char **pathp)

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.16

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