]> granicus.if.org Git - php/commitdiff
Eliminated unnecessary getcwd() syscall
authorDmitry Stogov <dmitry@php.net>
Fri, 17 Mar 2006 10:46:02 +0000 (10:46 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 17 Mar 2006 10:46:02 +0000 (10:46 +0000)
main/fopen_wrappers.c

index 67bc0f7c40d6d6670b3b72828efffb5e2ac5908b..ad168277b69a3cd8ebaf4a90b8ee52b030ab3cfa 100644 (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);