From: Greg Beaver Date: Wed, 30 Apr 2008 23:06:57 +0000 (+0000) Subject: fix cwd test in php 5.2, now all tests pass in 5.2 on unix X-Git-Tag: RELEASE_2_0_0b1~128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2b8a56779b42359a29cd9f7ccda2b3295c321789;p=php fix cwd test in php 5.2, now all tests pass in 5.2 on unix --- diff --git a/ext/phar/util.c b/ext/phar/util.c index d89de1b1be..828975281e 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -309,11 +309,20 @@ char *phar_find_in_include_path(char *filename, int filename_len, phar_archive_d 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); }