diff options
| author | Scott MacVicar <scottmac@php.net> | 2007-10-09 10:06:34 +0000 |
|---|---|---|
| committer | Scott MacVicar <scottmac@php.net> | 2007-10-09 10:06:34 +0000 |
| commit | 7deeb54fe1a3146755ae80264798014adbe987a0 (patch) | |
| tree | b8cb3fc8bd32e0b0efd56cc729fe28acd445d53f /main | |
| parent | 6d078cea10ba3982016f6b16b4a74c5851b62849 (diff) | |
| download | php-git-7deeb54fe1a3146755ae80264798014adbe987a0.tar.gz | |
MFH: Fix expand_filepath when including relative files, ideally you should test your code...
Diffstat (limited to 'main')
| -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'; } } |
