diff options
| author | Paul Eggert | 2025-12-07 15:34:42 -0800 |
|---|---|---|
| committer | Paul Eggert | 2025-12-07 15:45:20 -0800 |
| commit | b211e5489b95f39f07baa769fc581b05b393c4a3 (patch) | |
| tree | 34f59c09f3779fdf25f32bccbe8aa48491ee5b4f /lib/string.in.h | |
| parent | 0d43f2a562c84ff440da978a9275fc44e6f5d9da (diff) | |
| download | emacs-b211e5489b95f39f07baa769fc581b05b393c4a3.tar.gz emacs-b211e5489b95f39f07baa769fc581b05b393c4a3.zip | |
Update from Gnulib by running admin/merge-gnulib
* admin/merge-gnulib (AVOIDED_MODULES): Add strncpy, as Emacs is not
likely to exercise the FreeBSD 15 strncpy bug that this module fixes.
* lib/issymlinkat.h: New file, taken from Gnulib.
Diffstat (limited to 'lib/string.in.h')
| -rw-r--r-- | lib/string.in.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/string.in.h b/lib/string.in.h index a323b1cd6da..f316878b4c9 100644 --- a/lib/string.in.h +++ b/lib/string.in.h | |||
| @@ -840,6 +840,35 @@ _GL_WARN_ON_USE (strncat, "strncat is unportable - " | |||
| 840 | # endif | 840 | # endif |
| 841 | #endif | 841 | #endif |
| 842 | 842 | ||
| 843 | /* Copy no more than N bytes of SRC to DST, returning DST. */ | ||
| 844 | #if @GNULIB_STRNCPY@ | ||
| 845 | # if @REPLACE_STRNCPY@ | ||
| 846 | # if !(defined __cplusplus && defined GNULIB_NAMESPACE) | ||
| 847 | # undef strncpy | ||
| 848 | # define strncpy rpl_strncpy | ||
| 849 | # endif | ||
| 850 | _GL_FUNCDECL_RPL (strncpy, char *, | ||
| 851 | (char *restrict __dst, char const *restrict __src, | ||
| 852 | size_t __n), | ||
| 853 | _GL_ARG_NONNULL ((1, 2))); | ||
| 854 | _GL_CXXALIAS_RPL (strncpy, char *, | ||
| 855 | (char *restrict __dst, char const *restrict __src, | ||
| 856 | size_t __n)); | ||
| 857 | # else | ||
| 858 | _GL_CXXALIAS_SYS (strncpy, char *, | ||
| 859 | (char *restrict __dst, char const *restrict __src, | ||
| 860 | size_t __n)); | ||
| 861 | # endif | ||
| 862 | # if __GLIBC__ >= 2 | ||
| 863 | _GL_CXXALIASWARN (strncpy); | ||
| 864 | # endif | ||
| 865 | #elif defined GNULIB_POSIXCHECK | ||
| 866 | # if HAVE_RAW_DECL_STRNCPY | ||
| 867 | _GL_WARN_ON_USE (strncpy, "strncpy is unportable - " | ||
| 868 | "use gnulib module strncpy for portability"); | ||
| 869 | # endif | ||
| 870 | #endif | ||
| 871 | |||
| 843 | /* Return a newly allocated copy of at most N bytes of STRING. */ | 872 | /* Return a newly allocated copy of at most N bytes of STRING. */ |
| 844 | #if @GNULIB_STRNDUP@ | 873 | #if @GNULIB_STRNDUP@ |
| 845 | # if @REPLACE_STRNDUP@ | 874 | # if @REPLACE_STRNDUP@ |