Enlightenment CVS committal Author : sebastid Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_file Modified Files: ecore_file.c Log Message: Skip env variables. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_file/ecore_file.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- ecore_file.c 7 Oct 2005 17:32:31 -0000 1.28 +++ ecore_file.c 7 Oct 2005 17:48:09 -0000 1.29 @@ -254,10 +254,11 @@ ecore_file_app_exe_get(const char *app) { char *p, *pp, *exe1 = NULL, *exe2 = NULL; - char *exe; - int in_quot_dbl = 0, in_quot_sing = 0; + char *exe = NULL; + int in_quot_dbl = 0, in_quot_sing = 0, restart = 0; p = (char *)app; +restart: while ((*p) && (isspace(*p))) p++; exe1 = p; while (*p) @@ -296,6 +297,7 @@ homedir = getenv("HOME"); if (!homedir) return NULL; len = strlen(homedir); + if (exe) free(exe); exe = malloc(len + exe2 - exe1 + 2); if (!exe) return NULL; pp = exe; @@ -312,11 +314,13 @@ } else { + if (exe) free(exe); exe = malloc(exe2 - exe1 + 1); if (!exe) return NULL; pp = exe; } p = exe1; + restart = 0; in_quot_dbl = 0; in_quot_sing = 0; while (*p) @@ -360,12 +364,23 @@ pp++; } } + else if ((p > exe1) && (*p == '=')) + { + restart = 1; + *pp = *p; + pp++; + } else if (*p == '\'') in_quot_sing = 1; else if (*p == '\"') in_quot_dbl = 1; else if (isspace(*p)) - break; + { + if (restart) + goto restart; + else + break; + } else { *pp = *p; ------------------------------------------------------- This SF.Net email is sponsored by: Power Architecture Resource Center: Free content, downloads, discussions, and more. http://solutions.newsforge.com/ibmarch.tmpl _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs