From 7ba8a98fd3d9a1a761f6fe5a5ad4aa7cadbd341c Mon Sep 17 00:00:00 2001 From: Scott MacVicar Date: Tue, 9 Oct 2007 10:04:19 +0000 Subject: [PATCH] Fix expand_filepath when including relative files, ideally you should test you code... --- main/fopen_wrappers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 920de5e824..265505acf5 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -593,8 +593,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'; } } -- 2.50.1