]> granicus.if.org Git - php/commitdiff
gwtcwd of NetWare LibC gives a cwd with a volume information.
authorAnantha Kesari H Y <hyanantha@php.net>
Thu, 7 Jul 2005 07:10:50 +0000 (07:10 +0000)
committerAnantha Kesari H Y <hyanantha@php.net>
Thu, 7 Jul 2005 07:10:50 +0000 (07:10 +0000)
So using getcwdpath which gives with volume information.
getcwdpath gives with directory seperator as \ which is against our DEFAULT_SLASH of /. So finding and replacing \ with /

-- Kamesh

TSRM/tsrm_virtual_cwd.c

index a5ec310030ba36af94a0e88cce746d76f2fcec23..c984f1451ea5b164e0ce5e47a2f9db562ac0eb3f 100644 (file)
 # endif
 #endif
 
+#ifdef NETWARE
+#include <fsio.h>
+#endif
+
 #ifndef HAVE_REALPATH
 #define realpath(x,y) strcpy(y,x)
 #endif
@@ -206,7 +210,20 @@ CWD_API void virtual_cwd_startup(void)
        char cwd[MAXPATHLEN];
        char *result;
 
+#ifdef NETWARE
+       result = getcwdpath(cwd, NULL, 1);
+       if(result)
+       {
+               char *c=cwd;
+               while(c = strchr(c, '\\'))
+               {
+                       *c='/';
+                       ++c;
+               }
+       }
+#else
        result = getcwd(cwd, sizeof(cwd));      
+#endif
        if (!result) {
                cwd[0] = '\0';
        }