From: Dmitry Stogov Date: Fri, 17 Mar 2006 10:42:31 +0000 (+0000) Subject: Eliminated unnecessary getcwd() syscall X-Git-Tag: php-5.1.3RC2~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63b3f5c0419fdd05053e0a2ecfb14833984a92a1;p=php Eliminated unnecessary getcwd() syscall --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 3cf8b77c89..750bf3dba8 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -518,9 +518,13 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC) char cwd[MAXPATHLEN]; char *result; - result = VCWD_GETCWD(cwd, MAXPATHLEN); - if (!result) { + if (IS_ABSOLUTE_PATH(filepath, strlen(filepath))) { cwd[0] = '\0'; + } else{ + result = VCWD_GETCWD(cwd, MAXPATHLEN); + if (!result) { + cwd[0] = '\0'; + } } new_state.cwd = strdup(cwd);