/[ascend]/trunk/base/generic/general/env.c
ViewVC logotype

Diff of /trunk/base/generic/general/env.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 588 by johnpye, Thu May 11 01:37:08 2006 UTC revision 589 by johnpye, Thu May 11 03:10:43 2006 UTC
# Line 73  char * env_subst(const char *path,GetEnv Line 73  char * env_subst(const char *path,GetEnv
73      }      }
74    
75      return env_subst_level(path,getenvptr, 0);      return env_subst_level(path,getenvptr, 0);
76    }
77    
78    
79    int env_import(const char *varname,GetEnvFn *getenvptr,PutEnvFn *putenvptr){
80        char *val = (*getenvptr)(varname);
81        char *envcmd;
82        if(val!=NULL){
83            envcmd = MALLOC(sizeof(char) * (strlen(varname) + 1 + strlen(val) + 1));
84            sprintf(envcmd,"%s=%s",varname,val);
85            return (*putenvptr)(envcmd);
86        }
87        return -1;
88  }  }
89    
90  char * env_subst_level(const char *path,GetEnvFn *getenvptr, int level){  char * env_subst_level(const char *path,GetEnvFn *getenvptr, int level){

Legend:
Removed from v.588  
changed lines
  Added in v.589

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22