svn: /php/php-src/branches/PHP_5_2/ext/zip/ php_zip.c
| From: | Guenter Knauf | Date: | Wed, 26 Aug 2009 02:16:41 +0000 |
| Subject: | svn: /php/php-src/branches/PHP_5_2/ext/zip/ php_zip.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-60229@lists.php.net to get a copy of this message | ||
guenter Wed, 26 Aug 2009 02:16:41 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=287723
Log:
fix bug #48640: cleaned up ifdef whoes, removed duplicate code.
Bug: http://bugs.php.net/48640 (Assigned) compilation broken
for NetWare because of wrong ifdefs
Changed paths:
U php/php-src/branches/PHP_5_2/ext/zip/php_zip.c
Modified: php/php-src/branches/PHP_5_2/ext/zip/php_zip.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/zip/php_zip.c 2009-08-26 00:53:36 UTC (rev 287722)
+++ php/php-src/branches/PHP_5_2/ext/zip/php_zip.c 2009-08-26 02:16:41 UTC (rev 287723)
@@ -148,51 +148,28 @@
}
return j;
}
-
+
path[len] = 0;
-#ifdef PHP_WIN32
tmp = tsrm_do_alloca(len+1);
memcpy(tmp, path, len+1);
-#elif defined(NETWARE)
- 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;
- }
+ 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;
- }
- 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;