diff options
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r-- | source3/lib/util.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 9982d105ad..ca17fbdcb4 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1260,11 +1260,18 @@ int ChDir(char *path) ********************************************************************/ static char *Dumb_GetWd(char *s) { + char *p; #ifdef USE_GETCWD - return ((char *)getcwd(s,sizeof(pstring))); + p = (char *)getcwd(s,sizeof(pstring)); #else - return ((char *)getwd(s)); + p = (char *)getwd(s)); #endif + if(!p) + return NULL; + + /* Ensure we always return in dos format. */ + unix_to_dos(p,True); + return p; } |