mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-01 20:12:01 +08:00
Use MAXPATHLEN when no PATH_MAX.
This commit is contained in:
@ -54,6 +54,8 @@
|
||||
|
||||
#include "inferior.h" /* for signed_pointer_to_address */
|
||||
|
||||
#include <sys/param.h> /* For MAXPATHLEN */
|
||||
|
||||
#include <readline/readline.h>
|
||||
|
||||
#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
|
||||
|
Reference in New Issue
Block a user