diff options
author | Scott MacVicar <scottmac@php.net> | 2007-10-09 10:05:08 +0000 |
---|---|---|
committer | Scott MacVicar <scottmac@php.net> | 2007-10-09 10:05:08 +0000 |
commit | 52debae82e59aca50c2c9a94799bef2bec86136f (patch) | |
tree | cfea09fcded345296a88fc6670246abe0c125faf /main/fopen_wrappers.c | |
parent | e2b5419e052f0a675220c6e5e7c266e5be5615e6 (diff) | |
download | php-git-52debae82e59aca50c2c9a94799bef2bec86136f.tar.gz |
MFH: Fix expand_filepath when including relative files, ideally you should test you code...
Diffstat (limited to 'main/fopen_wrappers.c')
-rw-r--r-- | main/fopen_wrappers.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 70b07ef8b2..e0122ff152 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -621,8 +621,10 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC) copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath); real_path = estrndup(filepath, copy_len); return real_path; + } else { + cwd[0] = '\0'; } - } else { + } else if (!result) { cwd[0] = '\0'; } } |