From 2d1b2124ee669f4bec0290923ee79c533c65524e Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 20 Jan 2002 00:44:47 +0000 Subject: [PATCH] Use MAXPATHLEN when no PATH_MAX. --- gdb/ChangeLog | 5 +++++ gdb/utils.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8ef59a1..9e68687 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2002-01-19 Andrew Cagney + + * utils.c: Include for MAXPATHLEN. + (gdb_realpath): Use MAXPATHLEN when PATH_MAX is not defined. + 2002-01-19 Jason Thorpe * alpha-tdep.c (alpha_call_dummy_words): New. diff --git a/gdb/utils.c b/gdb/utils.c index 83d1a97..e5182af 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -54,6 +54,8 @@ #include "inferior.h" /* for signed_pointer_to_address */ +#include /* For MAXPATHLEN */ + #include #ifdef USE_MMALLOC @@ -2538,7 +2540,13 @@ char * gdb_realpath (const char *filename) { #ifdef HAVE_REALPATH +#if defined (PATH_MAX) char buf[PATH_MAX]; +#elif defined (MAXPATHLEN) + char buf[MAXPATHLEN]; +#else +#error "Neither PATH_MAX nor MAXPATHLEN defined" +#endif char *rp = realpath (filename, buf); return xstrdup (rp ? rp : filename); #else -- 2.7.4