summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-03-17 10:42:31 +0000
committerDmitry Stogov <dmitry@php.net>2006-03-17 10:42:31 +0000
commit63b3f5c0419fdd05053e0a2ecfb14833984a92a1 (patch)
tree3748239d26739960733db896491e2091a2018454
parent652d77eca45e5db0f9256e6bcc4ba2dab5657bd3 (diff)
downloadphp-git-63b3f5c0419fdd05053e0a2ecfb14833984a92a1.tar.gz
Eliminated unnecessary getcwd() syscall
-rw-r--r--main/fopen_wrappers.c8
1 files changed, 6 insertions, 2 deletions
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);