file.c
/* Expands the ENV variables in path */
Expands the ENV variables in path
Expands the ENV variables in path
void file_expandPath(char *path)
{
    char *rem_path, *token;
    rem_path = strdup(path);
    token = strsep(&rem_path, "/");
    if (rem_path != NULL)
        sprintf(path, "%s/%s", getenv(++token) != NULL ? getenv(token) : token - 1, rem_path);
    else
        sprintf(path, "%s", getenv(++token) != NULL ? getenv(token) : token - 1);
}
void file_expandPath ( char * path ) { char * rem_path , * token ; rem_path = strdup ( path ) ; token = strsep ( & rem_path , " " ) ; if ( rem_path != NULL ) sprintf ( path , " " , getenv ( ++ token ) != NULL ? getenv ( token ) : token - 1 , rem_path ) ; else sprintf ( path , " " , getenv ( ++ token ) != NULL ? getenv ( token ) : token - 1 ) ; }
Expands the ENV variables in path
Expands the ENV variables in path