mirror of
https://github.com/php/php-src.git
synced 2025-08-21 01:45:16 +02:00
Eliminated unnecessary getcwd() syscall
This commit is contained in:
parent
8c5059c3ad
commit
c09bbfa2b8
1 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue