From abcc099c732489354f8f2be70b9a919fffeb3d84 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Wed, 5 Nov 2025 10:06:23 +0800 Subject: [PATCH] Fix the MS-DOS port and reading of symlink targets * doc/misc/eglot.texi (Eglot Features): Add comma after @xref. * msdos/sed2v2.inp (GNULIB_ISSYMLINK): Define to 1. * msdos/sedlibmk.inp (HAVE_RANDOM_H): Undefine, in line with its deletion from gnulib.mk. (GL_GNULIB_STRINGEQ): Define to 1. * src/msdos.c (careadlinkat): NULL terminate at the end of the data written, not one character beyond the same. --- doc/misc/eglot.texi | 2 +- msdos/sed2v2.inp | 1 + msdos/sedlibmk.inp | 2 +- src/msdos.c | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi index 449b871b776..93268ce7c15 100644 --- a/doc/misc/eglot.texi +++ b/doc/misc/eglot.texi @@ -449,7 +449,7 @@ command (@pxref{Eglot Commands}). On-the-fly succinct informative annotations, so-called @dfn{inlay hints}. Eglot adds special intangible text nearby certain identifiers, be it the type of a variable, or the name of a formal parameter in a -function call. @xref{Eglot Commands} and the +function call. @xref{Eglot Commands}, and the @code{eglot-inlay-hints-mode} minor mode. @item diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index cb44aea4634..34ad3cc5a8d 100644 --- a/msdos/sed2v2.inp +++ b/msdos/sed2v2.inp @@ -140,6 +140,7 @@ s/^#undef HAVE_DECL_STRTOIMAX *$/#define HAVE_DECL_STRTOIMAX 1/ s/^#undef HAVE_PDUMPER *$/#define HAVE_PDUMPER 1/ s/^#undef HAVE_STRTOLL *$/#define HAVE_STRTOLL 1/ s/^#undef HAVE_STRTOULL *$/#define HAVE_STRTOULL 1/ +s/^#undef GNULIB_ISSYMLINK *$/#define GNULIB_ISSYMLINK 1/ /^#undef ALIGNOF_INT *$/s/^.*$/#define ALIGNOF_INT 4/ /^#undef ALIGNOF_LONG *$/s/^.*$/#define ALIGNOF_LONG 4/ /^#undef ALIGNOF_LONG_LONG *$/s/^.*$/#define ALIGNOF_LONG_LONG 4/ diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 234943aa57e..b4368e06e9b 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -189,6 +189,7 @@ s/@PACKAGE@/emacs/ /^GL_GNULIB_MKOSTEMP *=/s/@GL_GNULIB_MKOSTEMP@/1/ /^GL_GNULIB_MKTIME *=/s/@GL_GNULIB_MKTIME@/1/ /^GL_GNULIB_SIGDESCR_NP *=/s/@GL_GNULIB_SIGDESCR_NP@/1/ +/^GL_GNULIB_STRINGEQ *=/s/@GL_GNULIB_STRINGEQ@/1/ /^GL_GNULIB_TIME_R *=/s/@GL_GNULIB_TIME_R@/1/ /^GL_GNULIB_TIMEGM *=/s/@GL_GNULIB_TIMEGM@/1/ /^GL_GNULIB_TIME_RZ *=/s/@GL_GNULIB_TIME_RZ@/1/ @@ -240,7 +241,6 @@ s/@PACKAGE@/emacs/ /^HAVE_PCLOSE *=/s/@HAVE_PCLOSE@/1/ /^HAVE_POPEN *=/s/@HAVE_POPEN@/1/ /^HAVE_POSIX_SIGNALBLOCKING *=/s/@HAVE_POSIX_SIGNALBLOCKING@/1/ -/^HAVE_RANDOM_H *=/s/@HAVE_RANDOM_H@/1/ /^HAVE_RAISE *=/s/@HAVE_RAISE@/1/ /^HAVE_RANDOM *=/s/@HAVE_RANDOM@/1/ /^HAVE_READDIR *=/s/@HAVE_READDIR@/1/ diff --git a/src/msdos.c b/src/msdos.c index ec36d0b2df3..0563e9b2422 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -3996,12 +3996,12 @@ careadlinkat (int fd, char const *filename, } else { - ssize_t len = preadlinkat (fd, filename, buffer, buffer_size); + ssize_t len = (*preadlinkat) (fd, filename, buffer, buffer_size); if (len < 0 || len == buffer_size) buffer = NULL; else - buffer[len + 1] = '\0'; + buffer[len] = '\0'; } return buffer; }