[OpenSDK-cvs] openSDK/src libc.cc,1.2,1.3
Status: Beta
Brought to you by:
nuno-lopes
|
From: Nuno L. <nun...@us...> - 2007-07-15 15:06:34
|
Update of /cvsroot/opensdk/openSDK/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv30504/src Modified Files: libc.cc Log Message: add a new function: resolve_case_insensitive_path, and use it in the fopen/open wrappers Index: libc.cc =================================================================== RCS file: /cvsroot/opensdk/openSDK/src/libc.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- libc.cc 25 Mar 2007 12:13:12 -0000 1.2 +++ libc.cc 15 Jul 2007 15:06:13 -0000 1.3 @@ -39,7 +39,12 @@ FILE *__wrap_fopen(const char *path, const char *mode) { path = (*path == '/' ? (path+1) : path); - return fopen(path, mode); + char *newpath = resolve_case_insensitive_path(path); + + FILE *fp = fopen(newpath, mode); + + free(newpath); + return fp; } @@ -47,7 +52,12 @@ int __wrap_open(const char *path, int flags, mode_t mode) { path = (*path == '/' ? (path+1) : path); - return open(path, flags, mode); + char *newpath = resolve_case_insensitive_path(path); + + int fd = open(newpath, flags, mode); + + free(newpath); + return fd; } } |