From: Anantha Kesari H Y Date: Thu, 7 Jul 2005 07:10:50 +0000 (+0000) Subject: gwtcwd of NetWare LibC gives a cwd with a volume information. X-Git-Tag: php-5.1.0b3~153 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=958803655eb54e082547c86ced97606b6202eb7a;p=php gwtcwd of NetWare LibC gives a cwd with a volume information. 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 --- diff --git a/TSRM/tsrm_virtual_cwd.c b/TSRM/tsrm_virtual_cwd.c index a5ec310030..c984f1451e 100644 --- a/TSRM/tsrm_virtual_cwd.c +++ b/TSRM/tsrm_virtual_cwd.c @@ -42,6 +42,10 @@ # endif #endif +#ifdef NETWARE +#include +#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'; }