CVS update by adrian xemacs/src ...

xemacs-cvs at xemacs.org xemacs-cvs at xemacs.org
Wed Nov 1 15:25:53 EST 2006


  User: adrian  
  Date: 06/11/01 21:25:53

  Modified:    xemacs/src ChangeLog sysdep.c nt.c intl-win32.c fileio.c
Log:
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 at 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.

Revision  Changes    Path
1.1004    +17 -3     XEmacs/xemacs/src/ChangeLog

Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.1003
retrieving revision 1.1004
diff -u -p -r1.1003 -r1.1004
--- ChangeLog	2006/10/30 11:36:59	1.1003
+++ ChangeLog	2006/11/01 20:25:48	1.1004
@@ -1,3 +1,17 @@
+2006-11-01  Adrian Aichner  <adrian at 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.
+
 2006-10-30  Malcolm Purvis  <malcolmp at xemacs.org>
 
 	* device-x.c (x_init_device):  Look in more directories when
@@ -42828,7 +42842,7 @@ Mon Mar 09 13:00:55 1998  Andy Piper  <a
 	angle brackets.
 	Use RTLD_GLOBAL as an open flag if it exists.
 
-1998-03-09  Martin Buchholz  <Martin Buchholz <martin at xemacs.org>>
+1998-03-09  Martin Buchholz <martin at xemacs.org>
 
 	* eldap.c (Fldap_search_internal): call garbage_collect_1 instead
 	of Fgarbage_collect.  The two are identical except the latter
@@ -42995,7 +43009,7 @@ Wed Mar 04 08:55:12 1998  Andy Piper  <a
 
 	* editfns.c (Ftemp_directory): Use build_ext_string.
 
-1998-03-02  Martin Buchholz  <Martin Buchholz <martin at xemacs.org>>
+1998-03-02  Martin Buchholz <martin at xemacs.org>
 
 	* symsinit.h: add prototype for syms_of_dlopen
 
@@ -45520,7 +45534,7 @@ Sun November 01 12:00:00 1997 <jhar at tard
 	* events.c (Fevent_modeline_position): Return nil if event is not
 	over modeline, as the docstring says.
 
-1997-11-05  Martin Buchholz  <Martin Buchholz <martin at xemacs.org>>
+1997-11-05  Martin Buchholz <martin at xemacs.org>
 
 	* s/aix3-1.h: Remove ^L character wich confuses AIX make.
 



1.84      +2 -0      XEmacs/xemacs/src/sysdep.c

Index: sysdep.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysdep.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -p -r1.83 -r1.84
--- sysdep.c	2005/09/27 05:32:21	1.83
+++ sysdep.c	2006/11/01 20:25:49	1.84
@@ -3491,6 +3491,7 @@ qxe_ctime (const time_t *t)
 size_t
 wcslen (const wchar_t *s)
 {
+  if (s == NULL) return NULL;
   const wchar_t *p = s;
 
   while (*p++)
@@ -3508,6 +3509,7 @@ wcslen (const wchar_t *s)
 char *
 strlwr (char *s)
 {
+  if (s == NULL) return NULL;
   REGISTER char *c;
 
   for (c = s; *c; c++)



1.49      +1 -0      XEmacs/xemacs/src/nt.c

Index: nt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/nt.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -p -r1.48 -r1.49
--- nt.c	2005/12/27 18:51:30	1.48
+++ nt.c	2006/11/01 20:25:50	1.49
@@ -1819,6 +1819,7 @@ mswindows_getdcwd (int drivelet)
     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;



1.17      +5 -0      XEmacs/xemacs/src/intl-win32.c

Index: intl-win32.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/intl-win32.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -p -r1.16 -r1.17
--- intl-win32.c	2005/09/16 08:51:26	1.16
+++ intl-win32.c	2006/11/01 20:25:50	1.17
@@ -1569,6 +1569,7 @@ mswindows_current_locale (void)
 int
 wcscmp (const wchar_t *s1, const wchar_t *s2)
 {
+  if (s1 == NULL || s2 == NULL) return NULL;
   while (*s1 != '\0' && *s1 == *s2)
     {
       s1++;
@@ -1585,6 +1586,7 @@ wcscmp (const wchar_t *s1, const wchar_t
 size_t
 wcslen (const wchar_t *str)
 {
+  if (str == NULL) return NULL;
   const wchar_t *start = str;
 
   while (*str)
@@ -1598,6 +1600,7 @@ wcslen (const wchar_t *str)
 wchar_t *
 wcsncpy (wchar_t *dst0, const wchar_t *src0, size_t count)
 {
+  if (dst0 == NULL || src0 == NULL) return NULL;
   wchar_t *dscan;
   const wchar_t *sscan;
 
@@ -1618,6 +1621,7 @@ wcsncpy (wchar_t *dst0, const wchar_t *s
 wchar_t *
 wcscpy (wchar_t *dst0, const wchar_t *src0)
 {
+  if (dst0 == NULL || src0 == NULL) return NULL;
   wchar_t *s = dst0;
 
   while ((*dst0++ = *src0++))
@@ -1629,6 +1633,7 @@ wcscpy (wchar_t *dst0, const wchar_t *sr
 wchar_t *
 wcsdup (const wchar_t *str)
 {
+  if (str == NULL) return NULL;
   int len = wcslen (str) + 1;
   wchar_t *val = xnew_array (wchar_t, len);
 



1.107     +11 -2     XEmacs/xemacs/src/fileio.c

Index: fileio.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/fileio.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -p -r1.106 -r1.107
--- fileio.c	2006/10/27 19:07:47	1.106
+++ fileio.c	2006/11/01 20:25:50	1.107
@@ -397,11 +397,20 @@ Given a Unix syntax file name, returns a
 
       if (wd)
 	{
+	  int size;
 	  qxestrcat (res, wd);
-	  if (!IS_DIRECTORY_SEP (res[qxestrlen (res) - 1]))
-	    qxestrcat (res, (Ibyte *) "/");
+	  size = qxestrlen (res);
+	  if (!IS_DIRECTORY_SEP (res[size - 1]))
+	    {
+	      res[size] = DIRECTORY_SEP;
+	      res[size + 1] = '\0';
+	    }
 	  beg = res;
 	  p = beg + qxestrlen (beg);
+	}
+      else
+	{
+	  return Qnil;
 	}
       if (wd)
 	xfree (wd, Ibyte *);





More information about the XEmacs-CVS mailing list