diff options
author | Andi Gutmans <andi@php.net> | 2000-09-02 16:08:24 +0000 |
---|---|---|
committer | Andi Gutmans <andi@php.net> | 2000-09-02 16:08:24 +0000 |
commit | 97d509cc95fdb12ed76a3b888fac1d846f321cee (patch) | |
tree | 8941593ca68338996682ac5feb4b56c3dbb0f474 /main/php_virtual_cwd.c | |
parent | 5bc9f72e859cb4d3a86bc7c87d2ba0e5cb72ca52 (diff) | |
download | php-git-97d509cc95fdb12ed76a3b888fac1d846f321cee.tar.gz |
- Get rid of unused code and stop including PHP's win95nt.h
Diffstat (limited to 'main/php_virtual_cwd.c')
-rw-r--r-- | main/php_virtual_cwd.c | 67 |
1 files changed, 2 insertions, 65 deletions
diff --git a/main/php_virtual_cwd.c b/main/php_virtual_cwd.c index e9132ad194..fd0c352bb0 100644 --- a/main/php_virtual_cwd.c +++ b/main/php_virtual_cwd.c @@ -29,7 +29,8 @@ #include <fcntl.h> #ifdef ZEND_WIN32 -#include "win95nt.h" +/* mode_t isn't defined on Windows */ +typedef int mode_t; #include <sys/utime.h> #endif @@ -722,70 +723,6 @@ CWD_API FILE *virtual_popen(const char *command, const char *type) #endif -#if 0 -/* taken from Apache 1.3 */ - -CWD_API void virtual_real_chdir_file(const char *file) -{ - const char *x; - char buf[4096]; - - x = strrchr(file, '/'); - if (x == NULL) { - chdir(file); - } - else if (x - file < sizeof(buf) - 1) { - memcpy(buf, file, x - file); - buf[x - file] = '\0'; - chdir(buf); - } - /* XXX: well, this is a silly function, no method of reporting an - * error... ah well. */ -} - -#endif - -#if 0 - -main(void) -{ - cwd_state state; - int length; - -#ifndef ZEND_WIN32 - state.cwd = malloc(PATH_MAX + 1); - state.cwd_length = PATH_MAX; - - while (getcwd(state.cwd, state.cwd_length) == NULL && errno == ERANGE) { - state.cwd_length <<= 1; - state.cwd = realloc(state.cwd, state.cwd_length + 1); - } -#else - state.cwd = strdup("d:\\foo\\bar"); -#endif - state.cwd_length = strlen(state.cwd); - -#define T(a) \ - printf("[%s] $ cd %s\n", virtual_getcwd_ex(&state, &length), a); \ - virtual_chdir(&state, strdup(a)); \ - printf("new path is %s\n", virtual_getcwd_ex(&state, &length)); - - T("..") - T("...") - T("foo") - T("../bar") - T(".../slash/../dot") - T("//baz") - T("andi/././././././///bar") - T("../andi/../bar") - T("...foo") - T("D:/flash/zone") - T("../foo/bar/../baz") - - return 0; -} - -#endif /* * Local variables: |