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,10 +433,14 @@ PHPAPI char *expand_filepath(const char *filepath, char *real_path TSRMLS_DC)
char cwd[MAXPATHLEN];
char *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);
new_state.cwd_length = strlen(cwd);