pajoye                                   Fri, 10 Sep 2010 19:21:02 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=303262

Log:
- remove 'UNC' from the target

Changed paths:
    U   php/php-src/branches/PHP_5_3/TSRM/tsrm_virtual_cwd.c
    U   php/php-src/trunk/TSRM/tsrm_virtual_cwd.c

Modified: php/php-src/branches/PHP_5_3/TSRM/tsrm_virtual_cwd.c
===================================================================
--- php/php-src/branches/PHP_5_3/TSRM/tsrm_virtual_cwd.c        2010-09-10 
18:20:43 UTC (rev 303261)
+++ php/php-src/branches/PHP_5_3/TSRM/tsrm_virtual_cwd.c        2010-09-10 
19:21:02 UTC (rev 303262)
@@ -249,9 +249,17 @@
                /* Skip first 4 characters if they are "\??\" */
                if(target[0] == '\\' && target[1] == '\\' && target[2] == '?' 
&& target[3] ==  '\\') {
                        char tmp[MAXPATHLEN];
-
+                       unsigned int offset = 4;
                        dwRet -= 4;
-                       memcpy(tmp, target + 4, dwRet);
+
+                       /* \??\UNC\ */
+                       if (dwRet > 7 && target[4] == 'U' && target[5] == 'N' 
&& target[6] == 'C') {
+                               offset += 2;
+                               dwRet -= 2;
+                               target[offset] = '\\';
+                       }
+
+                       memcpy(tmp, target + offset, dwRet);
                        memcpy(target, tmp, dwRet);
                }
        }

Modified: php/php-src/trunk/TSRM/tsrm_virtual_cwd.c
===================================================================
--- php/php-src/trunk/TSRM/tsrm_virtual_cwd.c   2010-09-10 18:20:43 UTC (rev 
303261)
+++ php/php-src/trunk/TSRM/tsrm_virtual_cwd.c   2010-09-10 19:21:02 UTC (rev 
303262)
@@ -249,9 +249,17 @@
                /* Skip first 4 characters if they are "\??\" */
                if(target[0] == '\\' && target[1] == '\\' && target[2] == '?' 
&& target[3] ==  '\\') {
                        char tmp[MAXPATHLEN];
+                       unsigned int offset = 4;
+                       dwRet -= 4;

-                       dwRet -= 4;
-                       memcpy(tmp, target + 4, dwRet);
+                       /* \??\UNC\ */
+                       if (dwRet > 7 && target[4] == 'U' && target[5] == 'N' 
&& target[6] == 'C') {
+                               offset += 2;
+                               dwRet -= 2;
+                               target[offset] = '\\';
+                       }
+
+                       memcpy(tmp, target + offset, dwRet);
                        memcpy(target, tmp, dwRet);
                }
        }

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to