cvs: pecl /phar util.c
| From: | Greg Beaver | Date: | Wed, 30 Apr 2008 23:06:56 +0000 |
| Subject: | cvs: pecl /phar util.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-10667@lists.php.net to get a copy of this message | ||
cellog Wed Apr 30 23:06:56 2008 UTC
Modified files:
/pecl/phar util.c
Log:
fix cwd test in php 5.2, now all tests pass in 5.2 on unix
http://cvs.php.net/viewvc.cgi/pecl/phar/util.c?r1=1.47&r2=1.48&diff_format=u
Index: pecl/phar/util.c
diff -u pecl/phar/util.c:1.47 pecl/phar/util.c:1.48
--- pecl/phar/util.c:1.47 Wed Apr 30 22:16:23 2008
+++ pecl/phar/util.c Wed Apr 30 23:06:56 2008
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: util.c,v 1.47 2008/04/30 22:16:23 cellog Exp $ */
+/* $Id: util.c,v 1.48 2008/04/30 23:06:56 cellog Exp $ */
#include "phar_internal.h"
#if !defined(PHP_VERSION_ID) || PHP_VERSION_ID < 50300
@@ -309,11 +309,20 @@
efree(entry);
try_len = filename_len;
test = phar_fix_filepath(estrndup(filename, filename_len), &try_len, 1 TSRMLS_CC);
- if (zend_hash_exists(&((*pphar)->manifest), test + 1, try_len - 1)) {
- spprintf(&ret, 0, "phar://%s%s", arch, test);
- efree(arch);
- efree(test);
- return ret;
+ if (*test == '/') {
+ if (zend_hash_exists(&((*pphar)->manifest), test + 1, try_len - 1)) {
+ spprintf(&ret, 0, "phar://%s%s", arch, test);
+ efree(arch);
+ efree(test);
+ return ret;
+ }
+ } else {
+ if (zend_hash_exists(&((*pphar)->manifest), test, try_len)) {
+ spprintf(&ret, 0, "phar://%s/%s", arch, test);
+ efree(arch);
+ efree(test);
+ return ret;
+ }
}
efree(test);
}