cvs: php4 /main fopen-wrappers.c

From: Date: Mon, 21 Aug 2000 04:30:25 +0000
Subject: cvs: php4 /main fopen-wrappers.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1281@lists.php.net to get a copy of this message
andi Sun Aug 20 21:30:25 2000 EDT Modified files: /php4/main fopen-wrappers.c Log: - Remove old/deprecated version of expand_filepath Index: php4/main/fopen-wrappers.c diff -u php4/main/fopen-wrappers.c:1.80 php4/main/fopen-wrappers.c:1.81 --- php4/main/fopen-wrappers.c:1.80 Sun Aug 20 12:56:24 2000 +++ php4/main/fopen-wrappers.c Sun Aug 20 21:30:25 2000 @@ -16,7 +16,7 @@ | Jim Winstead <jimw@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: fopen-wrappers.c,v 1.80 2000/08/20 19:56:24 andi Exp $ */ +/* $Id: fopen-wrappers.c,v 1.81 2000/08/21 04:30:25 andi Exp $ */ #include "php.h" #include "php_globals.h" @@ -1063,8 +1063,6 @@ } -#if 1 - PHPAPI char *expand_filepath(const char *filepath, char *real_path) { cwd_state new_state; @@ -1094,49 +1092,6 @@ return real_path; } -#else - -PHPAPI char *expand_filepath(char *filepath) -{ - char *retval = NULL; - - if (filepath[0] == '.') { - char *cwd = malloc(MAXPATHLEN + 1); - - if (V_GETCWD(cwd, MAXPATHLEN)) { - char *cwd_end = cwd + strlen(cwd); - - if (filepath[1] == '.') { /* parent directory - .. */ - /* erase the last directory name from the path */ -#ifdef PHP_WIN32 - while (*cwd_end != '/' || *cwd_end != '\\') { -#else - while (*cwd_end != '/') { -#endif - *cwd_end-- = 0; - } - filepath++; /* make filepath appear as a current directory path */ - } -#ifdef PHP_WIN32 - if (cwd_end > cwd && (*cwd_end == '/' || *cwd_end == '\\')) { /* remove trailing slashes */ -#else - if (cwd_end > cwd && *cwd_end == '/') { /* remove trailing slashes */ -#endif - *cwd_end-- = 0; - } - retval = (char *) malloc(strlen(cwd) + strlen(filepath) - 1 + 1); - strcpy(retval, cwd); - strcat(retval, filepath + 1); - free(cwd); - } - } - if (!retval) { - retval = strdup(filepath); - } - return retval; -} - -#endif /* * Local variables:

« previous php.cvs (#1281) next »