Eliminated unnecessary getcwd() syscall

This commit is contained in:
Dmitry Stogov 2006-03-17 10:46:02 +00:00
parent 8c5059c3ad
commit c09bbfa2b8

View file

@ -433,9 +433,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);