]> granicus.if.org Git - php/commitdiff
fix bug #48640: cleaned up ifdef whoes, removed duplicate code.
authorGuenter Knauf <guenter@php.net>
Wed, 26 Aug 2009 02:16:41 +0000 (02:16 +0000)
committerGuenter Knauf <guenter@php.net>
Wed, 26 Aug 2009 02:16:41 +0000 (02:16 +0000)
ext/zip/php_zip.c

index 632d0afe9a94236321398e0bbc1c8e8abcc39860..d85c65f800a8a89a568c4587d88fa30b086f1e63 100644 (file)
@@ -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;