On Sat, 28 Oct 2006 17:41:39 +0200 Kim Woelders <[EMAIL PROTECTED]> babbled:
> Enlightenment CVS wrote: > > Enlightenment CVS committal > > > > Author : onefang > > Project : e17 > > Module : libs/ecore > > > > Dir : e17/libs/ecore/src/lib/ecore_file > > > > > > Modified Files: > > Ecore_File.h ecore_file.c > > > > > > Log Message: > > Copy filename escaping code from e_utils to make it more generally > > available. Step 2 is to remove the original and have everything call this > > one instead. > > > > =================================================================== > > RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/Ecore_File.h,v > > retrieving revision 1.27 > > retrieving revision 1.28 > > diff -u -3 -r1.27 -r1.28 > > --- Ecore_File.h 8 Sep 2006 16:52:29 -0000 1.27 > > +++ Ecore_File.h 28 Oct 2006 08:48:11 -0000 1.28 > > @@ -76,6 +76,7 @@ > > EAPI char *ecore_file_readlink (const char *link); > > EAPI Ecore_List *ecore_file_ls (const char *dir); > > EAPI char *ecore_file_app_exe_get (const char *app); > > + EAPI char *ecore_file_escape_name (const char *filename); > > EAPI char *ecore_file_strip_ext (const char *file); > > > > EAPI Ecore_File_Monitor *ecore_file_monitor_add(const char *path, > > =================================================================== > > RCS file: /cvs/e/e17/libs/ecore/src/lib/ecore_file/ecore_file.c,v > > retrieving revision 1.49 > > retrieving revision 1.50 > > diff -u -3 -r1.49 -r1.50 > > --- ecore_file.c 15 Oct 2006 09:32:25 -0000 1.49 > > +++ ecore_file.c 28 Oct 2006 08:48:11 -0000 1.50 > > @@ -480,6 +480,40 @@ > > } > > > > EAPI char * > > +ecore_file_escape_name(const char *filename) > > +{ > > + const char *p; > > + char *q; > > + static char buf[PATH_MAX]; > > + > > + p = filename; > > + q = buf; > > + while (*p) > > + { > > + if ((q - buf) > (PATH_MAX - 6)) return NULL; > > + if ( > > + (*p == ' ') || (*p == '\t') || (*p == '\n') || > > + (*p == '\\') || (*p == '\'') || (*p == '\"') || > > + (*p == ';') || (*p == '!') || (*p == '#') || > > + (*p == '$') || (*p == '%') || (*p == '&') || > > + (*p == '*') || (*p == '(') || (*p == ')') || > > + (*p == '[') || (*p == ']') || (*p == '{') || > > + (*p == '}') || (*p == '|') || (*p == '<') || > > + (*p == '>') || (*p == '?') > > + ) > > + { > > + *q = '\\'; > > + q++; > > + } > > + *q = *p; > > + q++; > > + p++; > > + } > > + *q = 0; > > + return strdup(buf); > > +} > > + > > +EAPI char * > > ecore_file_strip_ext(const char *path) > > { > > char *p, *file = NULL; > > > Do you really want "static" in "static char buf[PATH_MAX]" ? no - thats a leftover from how it was used in e - to just not have to free up the returns when used as part of snprintf's. u don't want both a static and a strdup. :) > /Kim > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) [EMAIL PROTECTED] 裸好多 Tokyo, Japan (東京 日本) ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel