cvs: TSRM / tsrm_virtual_cwd.c

From: Date: Tue, 19 Aug 2008 15:00:38 +0000
Subject: cvs: TSRM / tsrm_virtual_cwd.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-7081@lists.php.net to get a copy of this message
dmitry Tue Aug 19 15:00:38 2008 UTC Modified files: /TSRM tsrm_virtual_cwd.c Log: Fixed support for short windows file names http://cvs.php.net/viewvc.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.128&r2=1.129&diff_format=u Index: TSRM/tsrm_virtual_cwd.c diff -u TSRM/tsrm_virtual_cwd.c:1.128 TSRM/tsrm_virtual_cwd.c:1.129 --- TSRM/tsrm_virtual_cwd.c:1.128 Mon Aug 18 10:28:00 2008 +++ TSRM/tsrm_virtual_cwd.c Tue Aug 19 15:00:38 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: tsrm_virtual_cwd.c,v 1.128 2008/08/18 10:28:00 dmitry Exp $ */ +/* $Id: tsrm_virtual_cwd.c,v 1.129 2008/08/19 15:00:38 dmitry Exp $ */ #include <sys/types.h> #include <sys/stat.h> @@ -690,13 +690,15 @@ return -1; } if (save) { - memcpy(path+j, data.cFileName, len-i+1); + i = strlen(data.cFileName); + memcpy(path+j, data.cFileName, i+1); + j += i; FindClose(hFind); } else { /* use the original file or directory name as it wasn't found */ memcpy(path+j, tmp+i, len-i+1); + j += (len-i); } - j += (len-i); #else if (j < 0 || j + len - i >= MAXPATHLEN-1) { tsrm_free_alloca(tmp, use_heap); @@ -816,7 +818,7 @@ } #endif - add_slash = (use_realpath != CWD_REALPATH) && path_length > 0 && IS_SLASH(resolved_path[path_length-1]); + add_slash = (use_realpath != CWD_REALPATH) && path_length > 0 && IS_SLASH(resolved_path[path_length-1]); t = CWDG(realpath_cache_ttl) ? 0 : -1; path_length = tsrm_realpath_r(resolved_path, start, path_length, &ll, &t, use_realpath, 0, NULL TSRMLS_CC);

« previous php.zend-engine.cvs (#7081) next »