# HG changeset patch # User Aidan Kehoe # Date 1199834897 -3600 # Node ID 1a14c304cb8ead170dfb5edbbbf341724629f2d1 # Parent 9aa16aa434b6c7378354c60985dc2218ceb60db0 Don't use PATH_MAX_EXTERNAL, non-Win32. 2008-01-08 Aidan Kehoe * text.h (MAX_XETCHAR_SIZE): Remove, eliminating a redefinition warning on Win32. * dumper.c (pdump_load): Don't use PATH_MAX_EXTERNAL, instead allocate enough for the path + DUMP_SLACK (space for .dmp and version information), already used on Win32 and #defined to be 100. diff -r 9aa16aa434b6 -r 1a14c304cb8e src/ChangeLog --- a/src/ChangeLog Tue Jan 08 12:47:42 2008 -0700 +++ b/src/ChangeLog Wed Jan 09 00:28:17 2008 +0100 @@ -1,3 +1,12 @@ +2008-01-08 Aidan Kehoe + + * text.h (MAX_XETCHAR_SIZE): Remove, eliminating a redefinition + warning on Win32. + * dumper.c (pdump_load): + Don't use PATH_MAX_EXTERNAL, instead allocate enough for the path + + DUMP_SLACK (space for .dmp and version information), already + used on Win32 and #defined to be 100. + 2008-01-08 Jerry James * config.h.in (INLINE_HEADER): adapt to C99 inline semantics. diff -r 9aa16aa434b6 -r 1a14c304cb8e src/dumper.c --- a/src/dumper.c Tue Jan 08 12:47:42 2008 -0700 +++ b/src/dumper.c Wed Jan 09 00:28:17 2008 +0100 @@ -2630,6 +2630,8 @@ return 0; } +#define DUMP_SLACK 100 /* Enough to include dump ID, version name, .DMP */ + int pdump_load (const Wexttext *argv0) { @@ -2637,7 +2639,6 @@ 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. */ @@ -2659,7 +2660,7 @@ wext_strcpy (exe_path, wexe); } #else /* !WIN32_NATIVE */ - Wexttext exe_path[PATH_MAX_EXTERNAL]; + Wexttext *exe_path; Wexttext *w; const Wexttext *dir, *p; @@ -2694,13 +2695,17 @@ { /* invocation-name includes a directory component -- presumably it is relative to cwd, not $PATH. */ + exe_path = alloca_array (Wexttext, 1 + wext_strlen (dir) + DUMP_SLACK); wext_strcpy (exe_path, dir); } else { const Wexttext *path = wext_getenv ("PATH"); /* not egetenv -- - not yet init. */ + not yet init. */ const Wexttext *name = p; + exe_path = alloca_array (Wexttext, + 1 + DUMP_SLACK + max (wext_strlen (name), + wext_strlen (path))); for (;;) { p = path; diff -r 9aa16aa434b6 -r 1a14c304cb8e src/text.h --- a/src/text.h Tue Jan 08 12:47:42 2008 -0700 +++ b/src/text.h Wed Jan 09 00:28:17 2008 +0100 @@ -2988,7 +2988,6 @@ /* Extra indirection needed in case of manifest constant as arg */ #define WEXTSTRING_1(arg) L##arg #define WEXTSTRING(arg) WEXTSTRING_1(arg) -#define MAX_XETCHAR_SIZE sizeof (WCHAR) #define wext_strlen wcslen #define wext_strcmp wcscmp #define wext_strncmp wcsncmp @@ -3014,7 +3013,6 @@ #else #define WEXTTEXT_ZTERM_SIZE sizeof (char) #define WEXTSTRING(arg) arg -#define MAX_XETCHAR_SIZE sizeof (char) #define wext_strlen strlen #define wext_strcmp strcmp #define wext_strncmp strncmp