]> granicus.if.org Git - php/commitdiff
- Get rid of unused code and stop including PHP's win95nt.h
authorAndi Gutmans <andi@php.net>
Sat, 2 Sep 2000 16:08:24 +0000 (16:08 +0000)
committerAndi Gutmans <andi@php.net>
Sat, 2 Sep 2000 16:08:24 +0000 (16:08 +0000)
main/php_virtual_cwd.c

index e9132ad194d5502d3c341bdaeeb2f8bae2256685..fd0c352bb08e628300cd370f4001b8ab0883be33 100644 (file)
@@ -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: