Skip to content

Commit

Permalink
- remove 'UNC' from the target
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrejoye committed Sep 10, 2010
1 parent 77d307c commit cd727b4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions TSRM/tsrm_virtual_cwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,17 @@ CWD_API int php_sys_readlink(const char *link, char *target, size_t target_len){
/* 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);
}
}
Expand Down

0 comments on commit cd727b4

Please sign in to comment.