diff src/nt.c @ 3648:3e7493e76dc7

[xemacs-hg @ 2006-11-01 20:25:48 by adrian] fix for ffap crash on Windows (was: [Bug: 21.5-b27] [CRASH] (file-name-directory "1:")) -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2006-11-01 Adrian Aichner <adrian@xemacs.org> * sysdep.c (wcslen): Check for NULL pointer. * sysdep.c (strlwr): Ditto. * nt.c (mswindows_getdcwd): Ditto (actual cause of reported crash). * intl-win32.c (wcscmp): Ditto. * intl-win32.c (wcslen): Ditto. * intl-win32.c (wcsncpy): Ditto. * intl-win32.c (wcscpy): Ditto. * intl-win32.c (wcsdup): Ditto. * fileio.c (Ffile_name_directory): Return Qnil when mswindows_getdcwd returns NULL working directory.
author adrian
date Wed, 01 Nov 2006 20:25:50 +0000
parents 15139dbf89f4
children 866b84b7c97e
line wrap: on
line diff
--- a/src/nt.c	Tue Oct 31 22:51:31 2006 +0000
+++ b/src/nt.c	Wed Nov 01 20:25:50 2006 +0000
@@ -1819,6 +1819,7 @@
     cwdext = (Extbyte *) _wgetdcwd (drivelet, NULL, 0);
   else
     cwdext = _getdcwd (drivelet, NULL, 0);
+  if (cwdext == NULL) return NULL;
   TSTR_TO_C_STRING_MALLOC (cwdext, cwd);
   xfree (cwdext, Extbyte *);
   return cwd;