cvs: TSRM(PHP_5_3) / tsrm_virtual_cwd.c

"Dmitry Stogov" <[email protected]>
Newsgroups gmane.comp.php.cvs.zend
Message-ID <cvsdmitry1219158021@cvsserver>
dmitry		Tue Aug 19 15:00:21 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /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.74.2.9.2.35.2.12&r2=1.74.2.9.2.35.2.13&diff_format=u
Index: TSRM/tsrm_virtual_cwd.c
diff -u TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.35.2.12 TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.35.2.13
--- TSRM/tsrm_virtual_cwd.c:1.74.2.9.2.35.2.12	Mon Aug 18 10:28:17 2008
+++ TSRM/tsrm_virtual_cwd.c	Tue Aug 19 15:00:20 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.35.2.12 2008/08/18 10:28:17 dmitry Exp $ */
+/* $Id: tsrm_virtual_cwd.c,v 1.74.2.9.2.35.2.13 2008/08/19 15:00:20 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);
@@ -817,7 +819,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);
 	



-- 
Zend Engine CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.