summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c53
1 files changed, 15 insertions, 38 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 632d0afe9a..d85c65f800 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -148,51 +148,28 @@ static int php_zip_realpath_r(char *path, int start, int len, int *ll, time_t *t
}
return j;
}
-
- path[len] = 0;
-#ifdef PHP_WIN32
- tmp = tsrm_do_alloca(len+1);
- memcpy(tmp, path, len+1);
-#elif defined(NETWARE)
+ path[len] = 0;
tmp = tsrm_do_alloca(len+1);
memcpy(tmp, path, len+1);
-#else
- tmp = tsrm_do_alloca(len+1);
- memcpy(tmp, path, len+1);
-
- {
-#endif
- if (i - 1 <= start) {
- j = start;
- } else {
- /* some leading directories may be unaccessable */
- j = php_zip_realpath_r(path, start, i-1, ll, t, use_realpath, 1, NULL TSRMLS_CC);
- if (j > start) {
- path[j++] = DEFAULT_SLASH;
- }
- }
-#ifdef PHP_WIN32
- if (j < 0 || j + len - i >= MAXPATHLEN-1) {
- tsrm_free_alloca(tmp);
- return -1;
- }
- {
- /* use the original file or directory name as it wasn't found */
- memcpy(path+j, tmp+i, len-i+1);
- j += (len-i);
- }
-#else
- if (j < 0 || j + len - i >= MAXPATHLEN-1) {
- tsrm_free_alloca(tmp);
- return -1;
+ if (i - 1 <= start) {
+ j = start;
+ } else {
+ /* some leading directories may be unaccessable */
+ j = php_zip_realpath_r(path, start, i-1, ll, t, use_realpath, 1, NULL TSRMLS_CC);
+ if (j > start) {
+ path[j++] = DEFAULT_SLASH;
}
- memcpy(path+j, tmp+i, len-i+1);
- j += (len-i);
}
-#endif
+ if (j < 0 || j + len - i >= MAXPATHLEN-1) {
+ tsrm_free_alloca(tmp);
+ return -1;
+ }
+ /* use the original file or directory name as it wasn't found */
+ memcpy(path+j, tmp+i, len-i+1);
+ j += (len-i);
tsrm_free_alloca(tmp);
return j;