NOTE: This patch has been committed.
src/ChangeLog addition:
2005-02-03 Ben Wing <ben(a)xemacs.org>
* dumper.c:
* dumper.c (pdump_file_try):
* dumper.c (DUMP_SLACK):
* dumper.c (pdump_load):
Include extra DUMP_SLACK when allocating space for exe path.
* glyphs-eimage.c:
Reformat comment.
* sysproc.h:
Delete out-of-date comment about abort.
build source patch:
Diff command: bash -ci "cvs-diff --show-c-function -no-changelog "
Files affected: src/sysproc.h src/glyphs-eimage.c src/dumper.c
Index: src/dumper.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/dumper.c,v
retrieving revision 1.24
diff -u -p -r1.24 dumper.c
--- src/dumper.c 2005/02/03 17:34:03 1.24
+++ src/dumper.c 2005/02/04 03:00:03
@@ -1,7 +1,7 @@
/* Portable data dumper for XEmacs.
Copyright (C) 1999-2000,2004 Olivier Galibert
Copyright (C) 2001 Martin Buchholz
- Copyright (C) 2001, 2002, 2003, 2004 Ben Wing.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005 Ben Wing.
This file is part of XEmacs.
@@ -2084,6 +2084,10 @@ pdump_file_try (Wexttext *exe_path)
{
Wexttext *w = exe_path + wext_strlen (exe_path);
+ /* We look for various names, including those with the version and dump ID,
+ those with just the dump ID, and those without either. We first try
+ adding directly to the executable name, then lopping off any extension
+ (e.g. .exe) or version name in the executable (xemacs-21.5.18). */
do
{
wext_sprintf (w, WEXTSTRING ("-%s-%08x.dmp"), WEXTSTRING
(EMACS_VERSION),
@@ -2128,6 +2132,7 @@ pdump_load (const Wexttext *argv0)
Wexttext *exe_path = NULL;
int bufsize = 4096;
int cchpathsize;
+#define DUMP_SLACK 100 /* Enough to include dump ID, version name, .DMP */
/* Copied from mswindows_get_module_file_name (). Not clear if it's
kosher to malloc() yet. */
@@ -2138,7 +2143,7 @@ pdump_load (const Wexttext *argv0)
bufsize);
if (!cchpathsize)
goto fail;
- if (cchpathsize + 1 <= bufsize)
+ if (cchpathsize + DUMP_SLACK <= bufsize)
break;
bufsize *= 2;
}
Index: src/glyphs-eimage.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/glyphs-eimage.c,v
retrieving revision 1.24
diff -u -p -r1.24 glyphs-eimage.c
--- src/glyphs-eimage.c 2005/01/24 23:33:57 1.24
+++ src/glyphs-eimage.c 2005/02/04 03:00:05
@@ -105,11 +105,12 @@ Lisp_Object Qpng;
BEGIN_C_DECLS
#ifdef WIN32_NATIVE
-/* #### Yuck! More horrifitude. tiffio.h, below, includes <windows.h>, which
- defines INT32 and INT16, the former differently and incompatibly from jmorecfg.h,
- included by jpeglib.h. We can disable the stuff in jmorecfg.h by defining XMD_H
- (clever, huh?); then we define these typedefs the way that <windows.h> wants
them
- (which is more correct, anyway; jmorecfg.h defines INT32 as `long'). */
+/* #### Yuck! More horrifitude. tiffio.h, below, includes <windows.h>,
+ which defines INT32 and INT16, the former differently and incompatibly
+ from jmorecfg.h, included by jpeglib.h. We can disable the stuff in
+ jmorecfg.h by defining XMD_H (clever, huh?); then we define these
+ typedefs the way that <windows.h> wants them (which is more correct,
+ anyway; jmorecfg.h defines INT32 as `long'). */
#define XMD_H
typedef signed int INT32;
typedef signed short INT16;
Index: src/sysproc.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sysproc.h,v
retrieving revision 1.16
diff -u -p -r1.16 sysproc.h
--- src/sysproc.h 2005/01/24 23:34:11 1.16
+++ src/sysproc.h 2005/02/04 03:00:07
@@ -41,10 +41,6 @@ Boston, MA 02111-1307, USA. */
This is not true with visual c though. The trick below works with
VC4.2b, 5.0 and 6.0. It assumes that VC is installed in a kind of
standard way, so include path ends with /include.
- NOTE: We also include this same file in s/windowsnt.h, to avoid problems
- because this file prototypes ABORT() and then lisp.h defines it as a
- macro, which must happen after the prototype. DO NOT remove the include
- here just because you "know" it's somewhere else as well.
*/
#include <../include/process.h>
#endif