summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-11-22 04:15:27 +0000
committerSascha Schumann <sas@php.net>2000-11-22 04:15:27 +0000
commit886fbabb0bb1dfbd9eea91567475463fab275be9 (patch)
tree20727d6ecd8bda6f5484b1389eb82f6c819aa146 /ext
parent5347ef17284f4cb4e5431b880e1eaacfb468fd33 (diff)
downloadphp-git-886fbabb0bb1dfbd9eea91567475463fab275be9.tar.gz
Don't access opt, if opt was not set.
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/string.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index f6452abd85..8745f55881 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -788,7 +788,7 @@ PHP_FUNCTION(pathinfo)
MAKE_STD_ZVAL(tmp);
array_init(tmp);
- if (opt == PHP_PATHINFO_DIRNAME || argc < 2) {
+ if (argc < 2 || opt == PHP_PATHINFO_DIRNAME) {
ret = estrndup(Z_STRVAL_PP(path), len);
php_dirname(ret, len);
if (*ret)
@@ -796,12 +796,12 @@ PHP_FUNCTION(pathinfo)
efree(ret);
}
- if (opt == PHP_PATHINFO_BASENAME || argc < 2) {
+ if (argc < 2 || opt == PHP_PATHINFO_BASENAME)
ret = php_basename(Z_STRVAL_PP(path), len);
add_assoc_string(tmp, "basename", ret, 0);
}
- if (opt == PHP_PATHINFO_EXTENSION || argc < 2) {
+ if (argc < 2 || opt == PHP_PATHINFO_EXTENSION) {
char *p;
int idx;