diff options
Diffstat (limited to 'gl/lib')
-rw-r--r-- | gl/lib/Makefile.am | 66 | ||||
-rw-r--r-- | gl/lib/Makefile.in | 362 | ||||
-rw-r--r-- | gl/lib/alloca.c | 35 | ||||
-rw-r--r-- | gl/lib/cdefs.h | 12 | ||||
-rw-r--r-- | gl/lib/fcntl.in.h | 4 | ||||
-rw-r--r-- | gl/lib/glob.c | 50 | ||||
-rw-r--r-- | gl/lib/lchown.c | 4 | ||||
-rw-r--r-- | gl/lib/libc-config.h | 11 | ||||
-rw-r--r-- | gl/lib/openat.h | 2 | ||||
-rw-r--r-- | gl/lib/readlinkat.c | 113 | ||||
-rw-r--r-- | gl/lib/regcomp.c | 16 | ||||
-rw-r--r-- | gl/lib/regex_internal.c | 22 | ||||
-rw-r--r-- | gl/lib/regexec.c | 5 | ||||
-rw-r--r-- | gl/lib/renameatu.c | 20 | ||||
-rw-r--r-- | gl/lib/statat.c | 21 | ||||
-rw-r--r-- | gl/lib/stdlib.in.h | 4 | ||||
-rw-r--r-- | gl/lib/stpcpy.c | 49 | ||||
-rw-r--r-- | gl/lib/str-two-way.h | 4 | ||||
-rw-r--r-- | gl/lib/string.in.h | 81 | ||||
-rw-r--r-- | gl/lib/sys_stat.in.h | 28 | ||||
-rw-r--r-- | gl/lib/termios.in.h | 73 | ||||
-rw-r--r-- | gl/lib/unlinkat.c | 5 | ||||
-rw-r--r-- | gl/lib/vasnprintf.c | 239 | ||||
-rw-r--r-- | gl/lib/verify.h | 5 | ||||
-rw-r--r-- | gl/lib/wchar.in.h | 24 |
25 files changed, 771 insertions, 484 deletions
diff --git a/gl/lib/Makefile.am b/gl/lib/Makefile.am index 8e04cbbb..a8e268e2 100644 --- a/gl/lib/Makefile.am +++ b/gl/lib/Makefile.am @@ -81,14 +81,17 @@ # setenv \ # sigaction \ # signal-h \ +# sigpipe \ # sigprocmask \ # stat-time \ # stdbool \ +# stpcpy \ # strcase \ # strcasestr \ # strerror \ # strsep \ # tempname \ +# termios \ # timespec \ # unlinkat \ # utimens \ @@ -1601,6 +1604,18 @@ endif ## end gnulib module readlink +## begin gnulib module readlinkat + +if GL_COND_OBJ_READLINKAT +libgnu_la_SOURCES += readlinkat.c +endif + +EXTRA_DIST += at-func.c + +EXTRA_libgnu_la_SOURCES += at-func.c + +## end gnulib module readlinkat + ## begin gnulib module realloc-gnu @@ -1807,6 +1822,15 @@ EXTRA_DIST += signal.in.h ## end gnulib module signal-h +## begin gnulib module sigpipe + + +EXTRA_DIST += stdio-write.c + +EXTRA_libgnu_la_SOURCES += stdio-write.c + +## end gnulib module sigpipe + ## begin gnulib module sigprocmask if GL_COND_OBJ_SIGPROCMASK @@ -1905,12 +1929,6 @@ EXTRA_DIST += stat-time.h ## end gnulib module stat-time -## begin gnulib module statat - -libgnu_la_SOURCES += statat.c - -## end gnulib module statat - ## begin gnulib module stdalign BUILT_SOURCES += $(STDALIGN_H) @@ -2356,6 +2374,14 @@ EXTRA_DIST += stdopen.h ## end gnulib module stdopen +## begin gnulib module stpcpy + +if GL_COND_OBJ_STPCPY +libgnu_la_SOURCES += stpcpy.c +endif + +## end gnulib module stpcpy + ## begin gnulib module strcase if GL_COND_OBJ_STRCASECMP @@ -2783,6 +2809,7 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \ -e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \ + -e 's/@''GNULIB_CHMOD''@/$(GL_GNULIB_CHMOD)/g' \ -e 's/@''GNULIB_FCHMODAT''@/$(GL_GNULIB_FCHMODAT)/g' \ -e 's/@''GNULIB_FSTAT''@/$(GL_GNULIB_FSTAT)/g' \ -e 's/@''GNULIB_FSTATAT''@/$(GL_GNULIB_FSTATAT)/g' \ @@ -2814,6 +2841,7 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \ -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \ + -e 's|@''REPLACE_CHMOD''@|$(REPLACE_CHMOD)|g' \ -e 's|@''REPLACE_FCHMODAT''@|$(REPLACE_FCHMODAT)|g' \ -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ @@ -2953,6 +2981,32 @@ EXTRA_DIST += tempname.h ## end gnulib module tempname +## begin gnulib module termios + +BUILT_SOURCES += termios.h + +# We need the following in order to create <termios.h> when the system +# version does not have all declarations. +termios.h: termios.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_TERMIOS_H''@|$(NEXT_TERMIOS_H)|g' \ + -e 's/@''GNULIB_TCGETSID''@/$(GL_GNULIB_TCGETSID)/g' \ + -e 's|@''HAVE_DECL_TCGETSID''@|$(HAVE_DECL_TCGETSID)|g' \ + -e 's|@''HAVE_TERMIOS_H''@|$(HAVE_TERMIOS_H)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + $(srcdir)/termios.in.h > $@-t + $(AM_V_at)mv $@-t $@ +MOSTLYCLEANFILES += termios.h termios.h-t + +EXTRA_DIST += termios.in.h + +## end gnulib module termios + ## begin gnulib module threadlib libgnu_la_SOURCES += glthread/threadlib.c diff --git a/gl/lib/Makefile.in b/gl/lib/Makefile.in index 69b555e4..1ef35a25 100644 --- a/gl/lib/Makefile.in +++ b/gl/lib/Makefile.in @@ -95,14 +95,17 @@ # setenv \ # sigaction \ # signal-h \ +# sigpipe \ # sigprocmask \ # stat-time \ # stdbool \ +# stpcpy \ # strcase \ # strcasestr \ # strerror \ # strsep \ # tempname \ +# termios \ # timespec \ # unlinkat \ # utimens \ @@ -254,40 +257,42 @@ host_triplet = @host@ @GL_COND_OBJ_RAWMEMCHR_TRUE@am__append_59 = rawmemchr.c @GL_COND_OBJ_READDIR_TRUE@am__append_60 = readdir.c @GL_COND_OBJ_READLINK_TRUE@am__append_61 = readlink.c -@GL_COND_OBJ_REALLOCARRAY_TRUE@am__append_62 = reallocarray.c -@GL_COND_OBJ_REGEX_TRUE@am__append_63 = regex.c -@GL_COND_OBJ_RENAME_TRUE@am__append_64 = rename.c -@GL_COND_OBJ_RENAMEAT_TRUE@am__append_65 = renameat.c -@GL_COND_OBJ_REWINDDIR_TRUE@am__append_66 = rewinddir.c -@GL_COND_OBJ_RMDIR_TRUE@am__append_67 = rmdir.c -@GL_COND_OBJ_SELECT_TRUE@am__append_68 = select.c -@GL_COND_OBJ_SETENV_TRUE@am__append_69 = setenv.c -@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__append_70 = setlocale-lock.c -@GL_COND_OBJ_SIGACTION_TRUE@am__append_71 = sigaction.c -@GL_COND_OBJ_SIGPROCMASK_TRUE@am__append_72 = sigprocmask.c -@GL_COND_OBJ_SLEEP_TRUE@am__append_73 = sleep.c -@GL_COND_OBJ_STAT_TRUE@am__append_74 = stat.c -@GL_COND_OBJ_STDIO_READ_TRUE@am__append_75 = stdio-read.c -@GL_COND_OBJ_STDIO_WRITE_TRUE@am__append_76 = stdio-write.c -@GL_COND_OBJ_STRCASECMP_TRUE@am__append_77 = strcasecmp.c -@GL_COND_OBJ_STRNCASECMP_TRUE@am__append_78 = strncasecmp.c -@GL_COND_OBJ_STRCHRNUL_TRUE@am__append_79 = strchrnul.c -@GL_COND_OBJ_STRDUP_TRUE@am__append_80 = strdup.c -@GL_COND_OBJ_STRERROR_TRUE@am__append_81 = strerror.c -@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__append_82 = strerror-override.c -@GL_COND_OBJ_STRNDUP_TRUE@am__append_83 = strndup.c -@GL_COND_OBJ_STRNLEN_TRUE@am__append_84 = strnlen.c -@GL_COND_OBJ_STRSEP_TRUE@am__append_85 = strsep.c -@GL_COND_OBJ_UNLINK_TRUE@am__append_86 = unlink.c -@GL_COND_OBJ_UNLINKAT_TRUE@am__append_87 = unlinkat.c -@GL_COND_OBJ_UTIME_TRUE@am__append_88 = utime.c -@GL_COND_OBJ_WCRTOMB_TRUE@am__append_89 = wcrtomb.c -@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__append_90 = windows-mutex.c -@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__append_91 = windows-once.c -@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__append_92 = windows-recmutex.c -@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__append_93 = windows-rwlock.c -@GL_COND_OBJ_WMEMCHR_TRUE@am__append_94 = wmemchr.c -@GL_COND_OBJ_WMEMPCPY_TRUE@am__append_95 = wmempcpy.c +@GL_COND_OBJ_READLINKAT_TRUE@am__append_62 = readlinkat.c +@GL_COND_OBJ_REALLOCARRAY_TRUE@am__append_63 = reallocarray.c +@GL_COND_OBJ_REGEX_TRUE@am__append_64 = regex.c +@GL_COND_OBJ_RENAME_TRUE@am__append_65 = rename.c +@GL_COND_OBJ_RENAMEAT_TRUE@am__append_66 = renameat.c +@GL_COND_OBJ_REWINDDIR_TRUE@am__append_67 = rewinddir.c +@GL_COND_OBJ_RMDIR_TRUE@am__append_68 = rmdir.c +@GL_COND_OBJ_SELECT_TRUE@am__append_69 = select.c +@GL_COND_OBJ_SETENV_TRUE@am__append_70 = setenv.c +@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__append_71 = setlocale-lock.c +@GL_COND_OBJ_SIGACTION_TRUE@am__append_72 = sigaction.c +@GL_COND_OBJ_SIGPROCMASK_TRUE@am__append_73 = sigprocmask.c +@GL_COND_OBJ_SLEEP_TRUE@am__append_74 = sleep.c +@GL_COND_OBJ_STAT_TRUE@am__append_75 = stat.c +@GL_COND_OBJ_STDIO_READ_TRUE@am__append_76 = stdio-read.c +@GL_COND_OBJ_STDIO_WRITE_TRUE@am__append_77 = stdio-write.c +@GL_COND_OBJ_STPCPY_TRUE@am__append_78 = stpcpy.c +@GL_COND_OBJ_STRCASECMP_TRUE@am__append_79 = strcasecmp.c +@GL_COND_OBJ_STRNCASECMP_TRUE@am__append_80 = strncasecmp.c +@GL_COND_OBJ_STRCHRNUL_TRUE@am__append_81 = strchrnul.c +@GL_COND_OBJ_STRDUP_TRUE@am__append_82 = strdup.c +@GL_COND_OBJ_STRERROR_TRUE@am__append_83 = strerror.c +@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__append_84 = strerror-override.c +@GL_COND_OBJ_STRNDUP_TRUE@am__append_85 = strndup.c +@GL_COND_OBJ_STRNLEN_TRUE@am__append_86 = strnlen.c +@GL_COND_OBJ_STRSEP_TRUE@am__append_87 = strsep.c +@GL_COND_OBJ_UNLINK_TRUE@am__append_88 = unlink.c +@GL_COND_OBJ_UNLINKAT_TRUE@am__append_89 = unlinkat.c +@GL_COND_OBJ_UTIME_TRUE@am__append_90 = utime.c +@GL_COND_OBJ_WCRTOMB_TRUE@am__append_91 = wcrtomb.c +@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__append_92 = windows-mutex.c +@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__append_93 = windows-once.c +@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__append_94 = windows-recmutex.c +@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__append_95 = windows-rwlock.c +@GL_COND_OBJ_WMEMCHR_TRUE@am__append_96 = wmemchr.c +@GL_COND_OBJ_WMEMPCPY_TRUE@am__append_97 = wmempcpy.c subdir = gl/lib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \ @@ -412,6 +417,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \ $(top_srcdir)/gl/m4/pthread_sigmask.m4 \ $(top_srcdir)/gl/m4/raise.m4 $(top_srcdir)/gl/m4/rawmemchr.m4 \ $(top_srcdir)/gl/m4/readdir.m4 $(top_srcdir)/gl/m4/readlink.m4 \ + $(top_srcdir)/gl/m4/readlinkat.m4 \ $(top_srcdir)/gl/m4/realloc.m4 \ $(top_srcdir)/gl/m4/reallocarray.m4 \ $(top_srcdir)/gl/m4/regex.m4 $(top_srcdir)/gl/m4/rename.m4 \ @@ -423,8 +429,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \ $(top_srcdir)/gl/m4/sigaction.m4 \ $(top_srcdir)/gl/m4/signal_h.m4 \ $(top_srcdir)/gl/m4/signalblocking.m4 \ - $(top_srcdir)/gl/m4/size_max.m4 $(top_srcdir)/gl/m4/sleep.m4 \ - $(top_srcdir)/gl/m4/socketlib.m4 \ + $(top_srcdir)/gl/m4/sigpipe.m4 $(top_srcdir)/gl/m4/size_max.m4 \ + $(top_srcdir)/gl/m4/sleep.m4 $(top_srcdir)/gl/m4/socketlib.m4 \ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \ $(top_srcdir)/gl/m4/ssize_t.m4 \ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \ @@ -432,7 +438,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stddef_h.m4 \ $(top_srcdir)/gl/m4/stdint.m4 $(top_srcdir)/gl/m4/stdint_h.m4 \ $(top_srcdir)/gl/m4/stdio_h.m4 $(top_srcdir)/gl/m4/stdlib_h.m4 \ - $(top_srcdir)/gl/m4/strcase.m4 \ + $(top_srcdir)/gl/m4/stpcpy.m4 $(top_srcdir)/gl/m4/strcase.m4 \ $(top_srcdir)/gl/m4/strcasestr.m4 \ $(top_srcdir)/gl/m4/strchrnul.m4 $(top_srcdir)/gl/m4/strdup.m4 \ $(top_srcdir)/gl/m4/strerror.m4 \ @@ -451,6 +457,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \ $(top_srcdir)/gl/m4/sys_uio_h.m4 \ $(top_srcdir)/gl/m4/sysexits.m4 \ $(top_srcdir)/gl/m4/tempname.m4 \ + $(top_srcdir)/gl/m4/termios_h.m4 \ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \ $(top_srcdir)/gl/m4/timespec.m4 \ $(top_srcdir)/gl/m4/unistd-safer.m4 \ @@ -516,25 +523,25 @@ am__libgnu_la_SOURCES_DIST = argp.h argp-ba.c argp-eexst.c \ pthread_sigmask.c raise.c rawmemchr.c gl_rbtree_list.h \ gl_rbtree_list.c gl_anyrbtree_list1.h gl_anyrbtree_list2.h \ gl_anytree_list1.h gl_anytree_list2.h readdir.c readlink.c \ - reallocarray.c regex.c rename.c renameat.c renameatu.c \ - rewinddir.c rmdir.c save-cwd.c malloc/scratch_buffer_dupfree.c \ - malloc/scratch_buffer_grow.c \ + readlinkat.c reallocarray.c regex.c rename.c renameat.c \ + renameatu.c rewinddir.c rmdir.c save-cwd.c \ + malloc/scratch_buffer_dupfree.c malloc/scratch_buffer_grow.c \ malloc/scratch_buffer_grow_preserve.c \ malloc/scratch_buffer_set_array_size.c select.c gl_set.h \ gl_set.c setenv.c setlocale_null.c setlocale-lock.c \ sigaction.c sig-handler.c sigprocmask.c size_max.h sleep.c \ - sockets.h sockets.c stat.c stat-time.c statat.c stdio-read.c \ - stdio-write.c stdopen.c strcasecmp.c strncasecmp.c strchrnul.c \ - strdup.c strerror.c strerror-override.c strndup.c strnlen.c \ - strnlen1.h strnlen1.c strsep.c sys_socket.c tempname.c \ - glthread/threadlib.c timespec.c unistd.c dup-safer.c \ - fd-safer.c pipe-safer.c unlink.c unlinkat.c utime.c utimens.c \ - verror.h verror.c wcrtomb.c wctype-h.c windows-mutex.c \ - windows-once.c windows-recmutex.c windows-rwlock.c wmemchr.c \ - wmempcpy.c xmalloc.c xalloc-die.c xgetcwd.c gl_xlist.h \ - gl_xlist.c gl_xmap.h gl_xmap.c gl_xset.h gl_xset.c xsize.h \ - xsize.c xstdopen.c xstrndup.h xstrndup.c xvasprintf.h \ - xvasprintf.c xasprintf.c + sockets.h sockets.c stat.c stat-time.c stdio-read.c \ + stdio-write.c stdopen.c stpcpy.c strcasecmp.c strncasecmp.c \ + strchrnul.c strdup.c strerror.c strerror-override.c strndup.c \ + strnlen.c strnlen1.h strnlen1.c strsep.c sys_socket.c \ + tempname.c glthread/threadlib.c timespec.c unistd.c \ + dup-safer.c fd-safer.c pipe-safer.c unlink.c unlinkat.c \ + utime.c utimens.c verror.h verror.c wcrtomb.c wctype-h.c \ + windows-mutex.c windows-once.c windows-recmutex.c \ + windows-rwlock.c wmemchr.c wmempcpy.c xmalloc.c xalloc-die.c \ + xgetcwd.c gl_xlist.h gl_xlist.c gl_xmap.h gl_xmap.c gl_xset.h \ + gl_xset.c xsize.h xsize.c xstdopen.c xstrndup.h xstrndup.c \ + xvasprintf.h xvasprintf.c xasprintf.c @GL_COND_OBJ_BTOWC_TRUE@am__objects_1 = libgnu_la-btowc.lo @GL_COND_OBJ_CANONICALIZE_LGPL_TRUE@am__objects_2 = libgnu_la-canonicalize-lgpl.lo @GL_COND_OBJ_CHDIR_LONG_TRUE@am__objects_3 = libgnu_la-chdir-long.lo @@ -606,48 +613,50 @@ am__dirstamp = $(am__leading_dot)dirstamp @GL_COND_OBJ_RAWMEMCHR_TRUE@am__objects_59 = libgnu_la-rawmemchr.lo @GL_COND_OBJ_READDIR_TRUE@am__objects_60 = libgnu_la-readdir.lo @GL_COND_OBJ_READLINK_TRUE@am__objects_61 = libgnu_la-readlink.lo -@GL_COND_OBJ_REALLOCARRAY_TRUE@am__objects_62 = \ +@GL_COND_OBJ_READLINKAT_TRUE@am__objects_62 = libgnu_la-readlinkat.lo +@GL_COND_OBJ_REALLOCARRAY_TRUE@am__objects_63 = \ @GL_COND_OBJ_REALLOCARRAY_TRUE@ libgnu_la-reallocarray.lo -@GL_COND_OBJ_REGEX_TRUE@am__objects_63 = libgnu_la-regex.lo -@GL_COND_OBJ_RENAME_TRUE@am__objects_64 = libgnu_la-rename.lo -@GL_COND_OBJ_RENAMEAT_TRUE@am__objects_65 = libgnu_la-renameat.lo -@GL_COND_OBJ_REWINDDIR_TRUE@am__objects_66 = libgnu_la-rewinddir.lo -@GL_COND_OBJ_RMDIR_TRUE@am__objects_67 = libgnu_la-rmdir.lo -@GL_COND_OBJ_SELECT_TRUE@am__objects_68 = libgnu_la-select.lo -@GL_COND_OBJ_SETENV_TRUE@am__objects_69 = libgnu_la-setenv.lo -@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__objects_70 = \ +@GL_COND_OBJ_REGEX_TRUE@am__objects_64 = libgnu_la-regex.lo +@GL_COND_OBJ_RENAME_TRUE@am__objects_65 = libgnu_la-rename.lo +@GL_COND_OBJ_RENAMEAT_TRUE@am__objects_66 = libgnu_la-renameat.lo +@GL_COND_OBJ_REWINDDIR_TRUE@am__objects_67 = libgnu_la-rewinddir.lo +@GL_COND_OBJ_RMDIR_TRUE@am__objects_68 = libgnu_la-rmdir.lo +@GL_COND_OBJ_SELECT_TRUE@am__objects_69 = libgnu_la-select.lo +@GL_COND_OBJ_SETENV_TRUE@am__objects_70 = libgnu_la-setenv.lo +@GL_COND_OBJ_SETLOCALE_LOCK_TRUE@am__objects_71 = \ @GL_COND_OBJ_SETLOCALE_LOCK_TRUE@ libgnu_la-setlocale-lock.lo -@GL_COND_OBJ_SIGACTION_TRUE@am__objects_71 = libgnu_la-sigaction.lo -@GL_COND_OBJ_SIGPROCMASK_TRUE@am__objects_72 = \ +@GL_COND_OBJ_SIGACTION_TRUE@am__objects_72 = libgnu_la-sigaction.lo +@GL_COND_OBJ_SIGPROCMASK_TRUE@am__objects_73 = \ @GL_COND_OBJ_SIGPROCMASK_TRUE@ libgnu_la-sigprocmask.lo -@GL_COND_OBJ_SLEEP_TRUE@am__objects_73 = libgnu_la-sleep.lo -@GL_COND_OBJ_STAT_TRUE@am__objects_74 = libgnu_la-stat.lo -@GL_COND_OBJ_STDIO_READ_TRUE@am__objects_75 = libgnu_la-stdio-read.lo -@GL_COND_OBJ_STDIO_WRITE_TRUE@am__objects_76 = \ +@GL_COND_OBJ_SLEEP_TRUE@am__objects_74 = libgnu_la-sleep.lo +@GL_COND_OBJ_STAT_TRUE@am__objects_75 = libgnu_la-stat.lo +@GL_COND_OBJ_STDIO_READ_TRUE@am__objects_76 = libgnu_la-stdio-read.lo +@GL_COND_OBJ_STDIO_WRITE_TRUE@am__objects_77 = \ @GL_COND_OBJ_STDIO_WRITE_TRUE@ libgnu_la-stdio-write.lo -@GL_COND_OBJ_STRCASECMP_TRUE@am__objects_77 = libgnu_la-strcasecmp.lo -@GL_COND_OBJ_STRNCASECMP_TRUE@am__objects_78 = \ +@GL_COND_OBJ_STPCPY_TRUE@am__objects_78 = libgnu_la-stpcpy.lo +@GL_COND_OBJ_STRCASECMP_TRUE@am__objects_79 = libgnu_la-strcasecmp.lo +@GL_COND_OBJ_STRNCASECMP_TRUE@am__objects_80 = \ @GL_COND_OBJ_STRNCASECMP_TRUE@ libgnu_la-strncasecmp.lo -@GL_COND_OBJ_STRCHRNUL_TRUE@am__objects_79 = libgnu_la-strchrnul.lo -@GL_COND_OBJ_STRDUP_TRUE@am__objects_80 = libgnu_la-strdup.lo -@GL_COND_OBJ_STRERROR_TRUE@am__objects_81 = libgnu_la-strerror.lo -@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__objects_82 = libgnu_la-strerror-override.lo -@GL_COND_OBJ_STRNDUP_TRUE@am__objects_83 = libgnu_la-strndup.lo -@GL_COND_OBJ_STRNLEN_TRUE@am__objects_84 = libgnu_la-strnlen.lo -@GL_COND_OBJ_STRSEP_TRUE@am__objects_85 = libgnu_la-strsep.lo -@GL_COND_OBJ_UNLINK_TRUE@am__objects_86 = libgnu_la-unlink.lo -@GL_COND_OBJ_UNLINKAT_TRUE@am__objects_87 = libgnu_la-unlinkat.lo -@GL_COND_OBJ_UTIME_TRUE@am__objects_88 = libgnu_la-utime.lo -@GL_COND_OBJ_WCRTOMB_TRUE@am__objects_89 = libgnu_la-wcrtomb.lo -@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__objects_90 = \ +@GL_COND_OBJ_STRCHRNUL_TRUE@am__objects_81 = libgnu_la-strchrnul.lo +@GL_COND_OBJ_STRDUP_TRUE@am__objects_82 = libgnu_la-strdup.lo +@GL_COND_OBJ_STRERROR_TRUE@am__objects_83 = libgnu_la-strerror.lo +@GL_COND_OBJ_STRERROR_OVERRIDE_TRUE@am__objects_84 = libgnu_la-strerror-override.lo +@GL_COND_OBJ_STRNDUP_TRUE@am__objects_85 = libgnu_la-strndup.lo +@GL_COND_OBJ_STRNLEN_TRUE@am__objects_86 = libgnu_la-strnlen.lo +@GL_COND_OBJ_STRSEP_TRUE@am__objects_87 = libgnu_la-strsep.lo +@GL_COND_OBJ_UNLINK_TRUE@am__objects_88 = libgnu_la-unlink.lo +@GL_COND_OBJ_UNLINKAT_TRUE@am__objects_89 = libgnu_la-unlinkat.lo +@GL_COND_OBJ_UTIME_TRUE@am__objects_90 = libgnu_la-utime.lo +@GL_COND_OBJ_WCRTOMB_TRUE@am__objects_91 = libgnu_la-wcrtomb.lo +@GL_COND_OBJ_WINDOWS_MUTEX_TRUE@am__objects_92 = \ @GL_COND_OBJ_WINDOWS_MUTEX_TRUE@ libgnu_la-windows-mutex.lo -@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__objects_91 = \ +@GL_COND_OBJ_WINDOWS_ONCE_TRUE@am__objects_93 = \ @GL_COND_OBJ_WINDOWS_ONCE_TRUE@ libgnu_la-windows-once.lo -@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__objects_92 = libgnu_la-windows-recmutex.lo -@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__objects_93 = \ +@GL_COND_OBJ_WINDOWS_RECMUTEX_TRUE@am__objects_94 = libgnu_la-windows-recmutex.lo +@GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@am__objects_95 = \ @GL_COND_OBJ_WINDOWS_RWLOCK_TRUE@ libgnu_la-windows-rwlock.lo -@GL_COND_OBJ_WMEMCHR_TRUE@am__objects_94 = libgnu_la-wmemchr.lo -@GL_COND_OBJ_WMEMPCPY_TRUE@am__objects_95 = libgnu_la-wmempcpy.lo +@GL_COND_OBJ_WMEMCHR_TRUE@am__objects_96 = libgnu_la-wmemchr.lo +@GL_COND_OBJ_WMEMPCPY_TRUE@am__objects_97 = libgnu_la-wmempcpy.lo am_libgnu_la_OBJECTS = libgnu_la-argp-ba.lo libgnu_la-argp-eexst.lo \ libgnu_la-argp-fmtstream.lo libgnu_la-argp-fs-xinl.lo \ libgnu_la-argp-help.lo libgnu_la-argp-parse.lo \ @@ -697,30 +706,30 @@ am_libgnu_la_OBJECTS = libgnu_la-argp-ba.lo libgnu_la-argp-eexst.lo \ $(am__objects_59) libgnu_la-gl_rbtree_list.lo \ $(am__objects_60) $(am__objects_61) $(am__objects_62) \ $(am__objects_63) $(am__objects_64) $(am__objects_65) \ - libgnu_la-renameatu.lo $(am__objects_66) $(am__objects_67) \ - libgnu_la-save-cwd.lo \ + $(am__objects_66) libgnu_la-renameatu.lo $(am__objects_67) \ + $(am__objects_68) libgnu_la-save-cwd.lo \ malloc/libgnu_la-scratch_buffer_dupfree.lo \ malloc/libgnu_la-scratch_buffer_grow.lo \ malloc/libgnu_la-scratch_buffer_grow_preserve.lo \ malloc/libgnu_la-scratch_buffer_set_array_size.lo \ - $(am__objects_68) libgnu_la-gl_set.lo $(am__objects_69) \ - libgnu_la-setlocale_null.lo $(am__objects_70) \ - $(am__objects_71) libgnu_la-sig-handler.lo $(am__objects_72) \ - $(am__objects_73) libgnu_la-sockets.lo $(am__objects_74) \ - libgnu_la-stat-time.lo libgnu_la-statat.lo $(am__objects_75) \ - $(am__objects_76) libgnu_la-stdopen.lo $(am__objects_77) \ - $(am__objects_78) $(am__objects_79) $(am__objects_80) \ - $(am__objects_81) $(am__objects_82) $(am__objects_83) \ - $(am__objects_84) libgnu_la-strnlen1.lo $(am__objects_85) \ + $(am__objects_69) libgnu_la-gl_set.lo $(am__objects_70) \ + libgnu_la-setlocale_null.lo $(am__objects_71) \ + $(am__objects_72) libgnu_la-sig-handler.lo $(am__objects_73) \ + $(am__objects_74) libgnu_la-sockets.lo $(am__objects_75) \ + libgnu_la-stat-time.lo $(am__objects_76) $(am__objects_77) \ + libgnu_la-stdopen.lo $(am__objects_78) $(am__objects_79) \ + $(am__objects_80) $(am__objects_81) $(am__objects_82) \ + $(am__objects_83) $(am__objects_84) $(am__objects_85) \ + $(am__objects_86) libgnu_la-strnlen1.lo $(am__objects_87) \ libgnu_la-sys_socket.lo libgnu_la-tempname.lo \ glthread/libgnu_la-threadlib.lo libgnu_la-timespec.lo \ libgnu_la-unistd.lo libgnu_la-dup-safer.lo \ libgnu_la-fd-safer.lo libgnu_la-pipe-safer.lo \ - $(am__objects_86) $(am__objects_87) $(am__objects_88) \ - libgnu_la-utimens.lo libgnu_la-verror.lo $(am__objects_89) \ - libgnu_la-wctype-h.lo $(am__objects_90) $(am__objects_91) \ - $(am__objects_92) $(am__objects_93) $(am__objects_94) \ - $(am__objects_95) libgnu_la-xmalloc.lo libgnu_la-xalloc-die.lo \ + $(am__objects_88) $(am__objects_89) $(am__objects_90) \ + libgnu_la-utimens.lo libgnu_la-verror.lo $(am__objects_91) \ + libgnu_la-wctype-h.lo $(am__objects_92) $(am__objects_93) \ + $(am__objects_94) $(am__objects_95) $(am__objects_96) \ + $(am__objects_97) libgnu_la-xmalloc.lo libgnu_la-xalloc-die.lo \ libgnu_la-xgetcwd.lo libgnu_la-gl_xlist.lo \ libgnu_la-gl_xmap.lo libgnu_la-gl_xset.lo libgnu_la-xsize.lo \ libgnu_la-xstdopen.lo libgnu_la-xstrndup.lo \ @@ -878,6 +887,7 @@ am__depfiles_remade = ./$(DEPDIR)/alloca.Plo \ ./$(DEPDIR)/libgnu_la-rawmemchr.Plo \ ./$(DEPDIR)/libgnu_la-readdir.Plo \ ./$(DEPDIR)/libgnu_la-readlink.Plo \ + ./$(DEPDIR)/libgnu_la-readlinkat.Plo \ ./$(DEPDIR)/libgnu_la-realloc.Plo \ ./$(DEPDIR)/libgnu_la-reallocarray.Plo \ ./$(DEPDIR)/libgnu_la-regcomp.Plo \ @@ -902,10 +912,10 @@ am__depfiles_remade = ./$(DEPDIR)/alloca.Plo \ ./$(DEPDIR)/libgnu_la-stat-time.Plo \ ./$(DEPDIR)/libgnu_la-stat-w32.Plo \ ./$(DEPDIR)/libgnu_la-stat.Plo \ - ./$(DEPDIR)/libgnu_la-statat.Plo \ ./$(DEPDIR)/libgnu_la-stdio-read.Plo \ ./$(DEPDIR)/libgnu_la-stdio-write.Plo \ ./$(DEPDIR)/libgnu_la-stdopen.Plo \ + ./$(DEPDIR)/libgnu_la-stpcpy.Plo \ ./$(DEPDIR)/libgnu_la-strcasecmp.Plo \ ./$(DEPDIR)/libgnu_la-strcasestr.Plo \ ./$(DEPDIR)/libgnu_la-strchrnul.Plo \ @@ -1096,6 +1106,7 @@ ERRNO_H = @ERRNO_H@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ +FILECMD = @FILECMD@ FLOAT_H = @FLOAT_H@ FNMATCH_H = @FNMATCH_H@ GETOPT_CDEFS_H = @GETOPT_CDEFS_H@ @@ -1116,6 +1127,7 @@ GL_GNULIB_CALLOC_GNU = @GL_GNULIB_CALLOC_GNU@ GL_GNULIB_CALLOC_POSIX = @GL_GNULIB_CALLOC_POSIX@ GL_GNULIB_CANONICALIZE_FILE_NAME = @GL_GNULIB_CANONICALIZE_FILE_NAME@ GL_GNULIB_CHDIR = @GL_GNULIB_CHDIR@ +GL_GNULIB_CHMOD = @GL_GNULIB_CHMOD@ GL_GNULIB_CHOWN = @GL_GNULIB_CHOWN@ GL_GNULIB_CLOSE = @GL_GNULIB_CLOSE@ GL_GNULIB_CLOSEDIR = @GL_GNULIB_CLOSEDIR@ @@ -1407,6 +1419,7 @@ GL_GNULIB_STRVERSCMP = @GL_GNULIB_STRVERSCMP@ GL_GNULIB_SYMLINK = @GL_GNULIB_SYMLINK@ GL_GNULIB_SYMLINKAT = @GL_GNULIB_SYMLINKAT@ GL_GNULIB_SYSTEM_POSIX = @GL_GNULIB_SYSTEM_POSIX@ +GL_GNULIB_TCGETSID = @GL_GNULIB_TCGETSID@ GL_GNULIB_TIMEGM = @GL_GNULIB_TIMEGM@ GL_GNULIB_TIMESPEC_GET = @GL_GNULIB_TIMESPEC_GET@ GL_GNULIB_TIMESPEC_GETRES = @GL_GNULIB_TIMESPEC_GETRES@ @@ -1535,6 +1548,7 @@ HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@ HAVE_DECL_STRTOIMAX = @HAVE_DECL_STRTOIMAX@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@ HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@ +HAVE_DECL_TCGETSID = @HAVE_DECL_TCGETSID@ HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@ HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@ HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@ @@ -1712,6 +1726,7 @@ HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@ HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@ HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@ +HAVE_TERMIOS_H = @HAVE_TERMIOS_H@ HAVE_TIMEGM = @HAVE_TIMEGM@ HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@ HAVE_TIMESPEC_GETRES = @HAVE_TIMESPEC_GETRES@ @@ -1867,6 +1882,7 @@ NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@ NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@ +NEXT_AS_FIRST_DIRECTIVE_TERMIOS_H = @NEXT_AS_FIRST_DIRECTIVE_TERMIOS_H@ NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@ NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@ NEXT_AS_FIRST_DIRECTIVE_UTIME_H = @NEXT_AS_FIRST_DIRECTIVE_UTIME_H@ @@ -1902,6 +1918,7 @@ NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@ NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@ NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@ +NEXT_TERMIOS_H = @NEXT_TERMIOS_H@ NEXT_TIME_H = @NEXT_TIME_H@ NEXT_UNISTD_H = @NEXT_UNISTD_H@ NEXT_UTIME_H = @NEXT_UTIME_H@ @@ -1938,6 +1955,7 @@ REPLACE_BTOWC = @REPLACE_BTOWC@ REPLACE_CALLOC_FOR_CALLOC_GNU = @REPLACE_CALLOC_FOR_CALLOC_GNU@ REPLACE_CALLOC_FOR_CALLOC_POSIX = @REPLACE_CALLOC_FOR_CALLOC_POSIX@ REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@ +REPLACE_CHMOD = @REPLACE_CHMOD@ REPLACE_CHOWN = @REPLACE_CHOWN@ REPLACE_CLOSE = @REPLACE_CLOSE@ REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@ @@ -2316,28 +2334,28 @@ EXTRA_DIST = alloca.c alloca.in.h assure.h attribute.h basename-lgpl.h \ memchr.valgrind memmem.c memmem.c str-two-way.h msvc-inval.h \ msvc-nothrow.h windows-initguard.h nonblocking.h stdio-read.c \ stdio-write.c openat.h dirent-private.h pathmax.h \ - rawmemchr.valgrind dirent-private.h realloc.c realloc.c \ - regcomp.c regex.h regex_internal.c regex_internal.h regexec.c \ - at-func2.c at-func2.c renameatu.h dirent-private.h \ + rawmemchr.valgrind dirent-private.h at-func.c realloc.c \ + realloc.c regcomp.c regex.h regex_internal.c regex_internal.h \ + regexec.c at-func2.c at-func2.c renameatu.h dirent-private.h \ same-inode.h save-cwd.h malloc/scratch_buffer.h \ scratch_buffer.h setlocale_null.h windows-initguard.h \ - sig-handler.h signal.in.h _Noreturn.h arg-nonnull.h c++defs.h \ - warn-on-use.h w32sock.h stat-w32.c stat-w32.h stat-time.h \ - stdalign.in.h stdarg.in.h stdbool.in.h stddef.in.h stdint.in.h \ - stdio.in.h stdlib.in.h stdopen.h strcasestr.c str-two-way.h \ - strcasestr.c strchrnul.valgrind streq.h strerror-override.h \ - string.in.h strings.in.h sys_file.in.h sys_ioctl.in.h \ - sys_random.in.h sys_select.in.h sys_socket.in.h sys_stat.in.h \ - sys_time.in.h sys_types.in.h sys_uio.in.h sysexits.in.h \ - tempname.h time.in.h timespec.h unistd.in.h unistd--.h \ - unistd-safer.h at-func.c utime.in.h utimens.h asnprintf.c \ - float+.h printf-args.c printf-args.h printf-parse.c \ - printf-parse.h vasnprintf.c vasnprintf.h asprintf.c \ - vasprintf.c verify.h vsnprintf.c wchar.in.h wctype.in.h \ - windows-initguard.h windows-mutex.h windows-once.h \ - windows-initguard.h windows-recmutex.h windows-initguard.h \ - windows-rwlock.h wmemchr-impl.h xalloc.h xalloc.h \ - xalloc-oversized.h xgetcwd.h xstdopen.h xalloc.h + sig-handler.h signal.in.h stdio-write.c _Noreturn.h \ + arg-nonnull.h c++defs.h warn-on-use.h w32sock.h stat-w32.c \ + stat-w32.h stat-time.h stdalign.in.h stdarg.in.h stdbool.in.h \ + stddef.in.h stdint.in.h stdio.in.h stdlib.in.h stdopen.h \ + strcasestr.c str-two-way.h strcasestr.c strchrnul.valgrind \ + streq.h strerror-override.h string.in.h strings.in.h \ + sys_file.in.h sys_ioctl.in.h sys_random.in.h sys_select.in.h \ + sys_socket.in.h sys_stat.in.h sys_time.in.h sys_types.in.h \ + sys_uio.in.h sysexits.in.h tempname.h termios.in.h time.in.h \ + timespec.h unistd.in.h unistd--.h unistd-safer.h at-func.c \ + utime.in.h utimens.h asnprintf.c float+.h printf-args.c \ + printf-args.h printf-parse.c printf-parse.h vasnprintf.c \ + vasnprintf.h asprintf.c vasprintf.c verify.h vsnprintf.c \ + wchar.in.h wctype.in.h windows-initguard.h windows-mutex.h \ + windows-once.h windows-initguard.h windows-recmutex.h \ + windows-initguard.h windows-rwlock.h wmemchr-impl.h xalloc.h \ + xalloc.h xalloc-oversized.h xgetcwd.h xstdopen.h xalloc.h BUILT_SOURCES = $(ALLOCA_H) ctype.h dirent.h malloc/dynarray.gl.h \ malloc/dynarray-skeleton.gl.h $(ERRNO_H) fcntl.h $(FLOAT_H) \ $(FNMATCH_H) $(GETOPT_H) $(GETOPT_CDEFS_H) $(GLOB_H) \ @@ -2346,7 +2364,8 @@ BUILT_SOURCES = $(ALLOCA_H) ctype.h dirent.h malloc/dynarray.gl.h \ $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h stdlib.h string.h \ strings.h sys/file.h sys/ioctl.h sys/random.h sys/select.h \ sys/socket.h sys/stat.h sys/time.h sys/types.h sys/uio.h \ - $(SYSEXITS_H) time.h unistd.h utime.h wchar.h wctype.h + $(SYSEXITS_H) termios.h time.h unistd.h utime.h wchar.h \ + wctype.h SUFFIXES = MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t ctype.h \ ctype.h-t dirent.h dirent.h-t malloc/dynarray.gl.h \ @@ -2365,8 +2384,9 @@ MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t ctype.h \ sys/random.h-t sys/select.h sys/select.h-t sys/socket.h \ sys/socket.h-t sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t \ sys/types.h sys/types.h-t sys/uio.h sys/uio.h-t sysexits.h \ - sysexits.h-t time.h time.h-t unistd.h unistd.h-t utime.h \ - utime.h-t wchar.h wchar.h-t wctype.h wctype.h-t + sysexits.h-t termios.h termios.h-t time.h time.h-t unistd.h \ + unistd.h-t utime.h utime.h-t wchar.h wchar.h-t wctype.h \ + wctype.h-t MOSTLYCLEANDIRS = sys sys sys sys sys sys sys CLEANFILES = DISTCLEANFILES = @@ -2418,25 +2438,25 @@ libgnu_la_SOURCES = argp.h argp-ba.c argp-eexst.c argp-fmtstream.c \ gl_anyrbtree_list1.h gl_anyrbtree_list2.h gl_anytree_list1.h \ gl_anytree_list2.h $(am__append_60) $(am__append_61) \ $(am__append_62) $(am__append_63) $(am__append_64) \ - $(am__append_65) renameatu.c $(am__append_66) $(am__append_67) \ - save-cwd.c malloc/scratch_buffer_dupfree.c \ + $(am__append_65) $(am__append_66) renameatu.c $(am__append_67) \ + $(am__append_68) save-cwd.c malloc/scratch_buffer_dupfree.c \ malloc/scratch_buffer_grow.c \ malloc/scratch_buffer_grow_preserve.c \ - malloc/scratch_buffer_set_array_size.c $(am__append_68) \ - gl_set.h gl_set.c $(am__append_69) setlocale_null.c \ - $(am__append_70) $(am__append_71) sig-handler.c \ - $(am__append_72) size_max.h $(am__append_73) sockets.h \ - sockets.c $(am__append_74) stat-time.c statat.c \ - $(am__append_75) $(am__append_76) stdopen.c $(am__append_77) \ - $(am__append_78) $(am__append_79) $(am__append_80) \ - $(am__append_81) $(am__append_82) $(am__append_83) \ - $(am__append_84) strnlen1.h strnlen1.c $(am__append_85) \ + malloc/scratch_buffer_set_array_size.c $(am__append_69) \ + gl_set.h gl_set.c $(am__append_70) setlocale_null.c \ + $(am__append_71) $(am__append_72) sig-handler.c \ + $(am__append_73) size_max.h $(am__append_74) sockets.h \ + sockets.c $(am__append_75) stat-time.c $(am__append_76) \ + $(am__append_77) stdopen.c $(am__append_78) $(am__append_79) \ + $(am__append_80) $(am__append_81) $(am__append_82) \ + $(am__append_83) $(am__append_84) $(am__append_85) \ + $(am__append_86) strnlen1.h strnlen1.c $(am__append_87) \ sys_socket.c tempname.c glthread/threadlib.c timespec.c \ - unistd.c dup-safer.c fd-safer.c pipe-safer.c $(am__append_86) \ - $(am__append_87) $(am__append_88) utimens.c verror.h verror.c \ - $(am__append_89) wctype-h.c $(am__append_90) $(am__append_91) \ - $(am__append_92) $(am__append_93) $(am__append_94) \ - $(am__append_95) xmalloc.c xalloc-die.c xgetcwd.c gl_xlist.h \ + unistd.c dup-safer.c fd-safer.c pipe-safer.c $(am__append_88) \ + $(am__append_89) $(am__append_90) utimens.c verror.h verror.c \ + $(am__append_91) wctype-h.c $(am__append_92) $(am__append_93) \ + $(am__append_94) $(am__append_95) $(am__append_96) \ + $(am__append_97) xmalloc.c xalloc-die.c xgetcwd.c gl_xlist.h \ gl_xlist.c gl_xmap.h gl_xmap.c gl_xset.h gl_xset.c xsize.h \ xsize.c xstdopen.c xstrndup.h xstrndup.c xvasprintf.h \ xvasprintf.c xasprintf.c @@ -2447,10 +2467,11 @@ EXTRA_libgnu_la_SOURCES = alloca.c calloc.c calloc.c stripslash.c \ malloc/dynarray-skeleton.c fnmatch.c fnmatch_loop.c fnmatch.c \ stat-w32.c at-func.c malloc.c malloc.c lc-charset-dispatch.c \ mbtowc-lock.c mbsrtowcs-state.c memmem.c memmem.c stdio-read.c \ - stdio-write.c realloc.c realloc.c regcomp.c regex_internal.c \ - regexec.c at-func2.c at-func2.c stat-w32.c strcasestr.c \ - strcasestr.c at-func.c asnprintf.c printf-args.c \ - printf-parse.c vasnprintf.c asprintf.c vasprintf.c vsnprintf.c + stdio-write.c at-func.c realloc.c realloc.c regcomp.c \ + regex_internal.c regexec.c at-func2.c at-func2.c stdio-write.c \ + stat-w32.c strcasestr.c strcasestr.c at-func.c asnprintf.c \ + printf-args.c printf-parse.c vasnprintf.c asprintf.c \ + vasprintf.c vsnprintf.c libgnu_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(LIBSOCKET) \ $(LIBTHREAD) $(LIB_CLOCK_GETTIME) $(LIB_GETLOGIN) \ $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) $(LIB_MBRTOWC) \ @@ -2726,6 +2747,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-rawmemchr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-readdir.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-readlink.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-readlinkat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-realloc.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-reallocarray.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-regcomp.Plo@am__quote@ # am--include-marker @@ -2750,10 +2772,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stat-time.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stat-w32.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stat.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-statat.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stdio-read.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stdio-write.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stdopen.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-stpcpy.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strcasecmp.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strcasestr.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgnu_la-strchrnul.Plo@am__quote@ # am--include-marker @@ -3649,6 +3671,13 @@ libgnu_la-readlink.lo: readlink.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-readlink.lo `test -f 'readlink.c' || echo '$(srcdir)/'`readlink.c +libgnu_la-readlinkat.lo: readlinkat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-readlinkat.lo -MD -MP -MF $(DEPDIR)/libgnu_la-readlinkat.Tpo -c -o libgnu_la-readlinkat.lo `test -f 'readlinkat.c' || echo '$(srcdir)/'`readlinkat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-readlinkat.Tpo $(DEPDIR)/libgnu_la-readlinkat.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='readlinkat.c' object='libgnu_la-readlinkat.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-readlinkat.lo `test -f 'readlinkat.c' || echo '$(srcdir)/'`readlinkat.c + libgnu_la-reallocarray.lo: reallocarray.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-reallocarray.lo -MD -MP -MF $(DEPDIR)/libgnu_la-reallocarray.Tpo -c -o libgnu_la-reallocarray.lo `test -f 'reallocarray.c' || echo '$(srcdir)/'`reallocarray.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-reallocarray.Tpo $(DEPDIR)/libgnu_la-reallocarray.Plo @@ -3817,13 +3846,6 @@ libgnu_la-stat-time.lo: stat-time.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-stat-time.lo `test -f 'stat-time.c' || echo '$(srcdir)/'`stat-time.c -libgnu_la-statat.lo: statat.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-statat.lo -MD -MP -MF $(DEPDIR)/libgnu_la-statat.Tpo -c -o libgnu_la-statat.lo `test -f 'statat.c' || echo '$(srcdir)/'`statat.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-statat.Tpo $(DEPDIR)/libgnu_la-statat.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statat.c' object='libgnu_la-statat.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-statat.lo `test -f 'statat.c' || echo '$(srcdir)/'`statat.c - libgnu_la-stdio-read.lo: stdio-read.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-stdio-read.lo -MD -MP -MF $(DEPDIR)/libgnu_la-stdio-read.Tpo -c -o libgnu_la-stdio-read.lo `test -f 'stdio-read.c' || echo '$(srcdir)/'`stdio-read.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-stdio-read.Tpo $(DEPDIR)/libgnu_la-stdio-read.Plo @@ -3845,6 +3867,13 @@ libgnu_la-stdopen.lo: stdopen.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-stdopen.lo `test -f 'stdopen.c' || echo '$(srcdir)/'`stdopen.c +libgnu_la-stpcpy.lo: stpcpy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-stpcpy.lo -MD -MP -MF $(DEPDIR)/libgnu_la-stpcpy.Tpo -c -o libgnu_la-stpcpy.lo `test -f 'stpcpy.c' || echo '$(srcdir)/'`stpcpy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-stpcpy.Tpo $(DEPDIR)/libgnu_la-stpcpy.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='stpcpy.c' object='libgnu_la-stpcpy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -c -o libgnu_la-stpcpy.lo `test -f 'stpcpy.c' || echo '$(srcdir)/'`stpcpy.c + libgnu_la-strcasecmp.lo: strcasecmp.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgnu_la_CFLAGS) $(CFLAGS) -MT libgnu_la-strcasecmp.lo -MD -MP -MF $(DEPDIR)/libgnu_la-strcasecmp.Tpo -c -o libgnu_la-strcasecmp.lo `test -f 'strcasecmp.c' || echo '$(srcdir)/'`strcasecmp.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgnu_la-strcasecmp.Tpo $(DEPDIR)/libgnu_la-strcasecmp.Plo @@ -4663,6 +4692,7 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/libgnu_la-rawmemchr.Plo -rm -f ./$(DEPDIR)/libgnu_la-readdir.Plo -rm -f ./$(DEPDIR)/libgnu_la-readlink.Plo + -rm -f ./$(DEPDIR)/libgnu_la-readlinkat.Plo -rm -f ./$(DEPDIR)/libgnu_la-realloc.Plo -rm -f ./$(DEPDIR)/libgnu_la-reallocarray.Plo -rm -f ./$(DEPDIR)/libgnu_la-regcomp.Plo @@ -4687,10 +4717,10 @@ distclean: distclean-recursive -rm -f ./$(DEPDIR)/libgnu_la-stat-time.Plo -rm -f ./$(DEPDIR)/libgnu_la-stat-w32.Plo -rm -f ./$(DEPDIR)/libgnu_la-stat.Plo - -rm -f ./$(DEPDIR)/libgnu_la-statat.Plo -rm -f ./$(DEPDIR)/libgnu_la-stdio-read.Plo -rm -f ./$(DEPDIR)/libgnu_la-stdio-write.Plo -rm -f ./$(DEPDIR)/libgnu_la-stdopen.Plo + -rm -f ./$(DEPDIR)/libgnu_la-stpcpy.Plo -rm -f ./$(DEPDIR)/libgnu_la-strcasecmp.Plo -rm -f ./$(DEPDIR)/libgnu_la-strcasestr.Plo -rm -f ./$(DEPDIR)/libgnu_la-strchrnul.Plo @@ -4920,6 +4950,7 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/libgnu_la-rawmemchr.Plo -rm -f ./$(DEPDIR)/libgnu_la-readdir.Plo -rm -f ./$(DEPDIR)/libgnu_la-readlink.Plo + -rm -f ./$(DEPDIR)/libgnu_la-readlinkat.Plo -rm -f ./$(DEPDIR)/libgnu_la-realloc.Plo -rm -f ./$(DEPDIR)/libgnu_la-reallocarray.Plo -rm -f ./$(DEPDIR)/libgnu_la-regcomp.Plo @@ -4944,10 +4975,10 @@ maintainer-clean: maintainer-clean-recursive -rm -f ./$(DEPDIR)/libgnu_la-stat-time.Plo -rm -f ./$(DEPDIR)/libgnu_la-stat-w32.Plo -rm -f ./$(DEPDIR)/libgnu_la-stat.Plo - -rm -f ./$(DEPDIR)/libgnu_la-statat.Plo -rm -f ./$(DEPDIR)/libgnu_la-stdio-read.Plo -rm -f ./$(DEPDIR)/libgnu_la-stdio-write.Plo -rm -f ./$(DEPDIR)/libgnu_la-stdopen.Plo + -rm -f ./$(DEPDIR)/libgnu_la-stpcpy.Plo -rm -f ./$(DEPDIR)/libgnu_la-strcasecmp.Plo -rm -f ./$(DEPDIR)/libgnu_la-strcasestr.Plo -rm -f ./$(DEPDIR)/libgnu_la-strchrnul.Plo @@ -6010,6 +6041,7 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \ -e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \ + -e 's/@''GNULIB_CHMOD''@/$(GL_GNULIB_CHMOD)/g' \ -e 's/@''GNULIB_FCHMODAT''@/$(GL_GNULIB_FCHMODAT)/g' \ -e 's/@''GNULIB_FSTAT''@/$(GL_GNULIB_FSTAT)/g' \ -e 's/@''GNULIB_FSTATAT''@/$(GL_GNULIB_FSTATAT)/g' \ @@ -6041,6 +6073,7 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \ -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \ -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \ + -e 's|@''REPLACE_CHMOD''@|$(REPLACE_CHMOD)|g' \ -e 's|@''REPLACE_FCHMODAT''@|$(REPLACE_FCHMODAT)|g' \ -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \ -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \ @@ -6126,6 +6159,23 @@ sys/uio.h: sys_uio.in.h $(top_builddir)/config.status @GL_GENERATE_SYSEXITS_H_FALSE@sysexits.h: $(top_builddir)/config.status @GL_GENERATE_SYSEXITS_H_FALSE@ rm -f $@ +# We need the following in order to create <termios.h> when the system +# version does not have all declarations. +termios.h: termios.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) + $(gl_V_at)$(SED_HEADER_STDOUT) \ + -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ + -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_TERMIOS_H''@|$(NEXT_TERMIOS_H)|g' \ + -e 's/@''GNULIB_TCGETSID''@/$(GL_GNULIB_TCGETSID)/g' \ + -e 's|@''HAVE_DECL_TCGETSID''@|$(HAVE_DECL_TCGETSID)|g' \ + -e 's|@''HAVE_TERMIOS_H''@|$(HAVE_TERMIOS_H)|g' \ + -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \ + -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \ + $(srcdir)/termios.in.h > $@-t + $(AM_V_at)mv $@-t $@ + # We need the following in order to create <time.h> when the system # doesn't have one that works with the given compiler. time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) diff --git a/gl/lib/alloca.c b/gl/lib/alloca.c index 48802832..5eb16a9f 100644 --- a/gl/lib/alloca.c +++ b/gl/lib/alloca.c @@ -30,17 +30,6 @@ #include <string.h> #include <stdlib.h> -#ifdef emacs -# include "lisp.h" -# include "blockinput.h" -# ifdef EMACS_FREE -# undef free -# define free EMACS_FREE -# endif -#else -# define memory_full() abort () -#endif - /* If compiling with GCC or clang, this file is not needed. */ #if !(defined __GNUC__ || defined __clang__) @@ -48,22 +37,6 @@ there must be some other way alloca is supposed to work. */ # ifndef alloca -# ifdef emacs -# ifdef static -/* actually, only want this if static is defined as "" - -- this is for usg, in which emacs must undefine static - in order to make unexec workable - */ -# ifndef STACK_DIRECTION -you -lose --- must know STACK_DIRECTION at compile-time -/* Using #error here is not wise since this file should work for - old and obscure compilers. */ -# endif /* STACK_DIRECTION undefined */ -# endif /* static */ -# endif /* emacs */ - /* Define STACK_DIRECTION if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. @@ -145,10 +118,6 @@ alloca (size_t size) { register header *hp; /* Traverses linked list. */ -# ifdef emacs - BLOCK_INPUT; -# endif - for (hp = last_alloca_header; hp != NULL;) if ((STACK_DIR > 0 && hp->h.deep > depth) || (STACK_DIR < 0 && hp->h.deep < depth)) @@ -163,10 +132,6 @@ alloca (size_t size) break; /* Rest are not deeper. */ last_alloca_header = hp; /* -> last valid storage. */ - -# ifdef emacs - UNBLOCK_INPUT; -# endif } if (size == 0) diff --git a/gl/lib/cdefs.h b/gl/lib/cdefs.h index cb251450..7b8ed5b3 100644 --- a/gl/lib/cdefs.h +++ b/gl/lib/cdefs.h @@ -164,13 +164,13 @@ || (__builtin_constant_p (__l) && (__l) > 0)) /* Length is known to be safe at compile time if the __L * __S <= __OBJSZ - condition can be folded to a constant and if it is true. The -1 check is - redundant because since it implies that __glibc_safe_len_cond is true. */ + condition can be folded to a constant and if it is true, or unknown (-1) */ #define __glibc_safe_or_unknown_len(__l, __s, __osz) \ - (__glibc_unsigned_or_positive (__l) \ - && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \ - __s, __osz)) \ - && __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), __s, __osz)) + ((__osz) == (__SIZE_TYPE__) -1 \ + || (__glibc_unsigned_or_positive (__l) \ + && __builtin_constant_p (__glibc_safe_len_cond ((__SIZE_TYPE__) (__l), \ + (__s), (__osz))) \ + && __glibc_safe_len_cond ((__SIZE_TYPE__) (__l), (__s), (__osz)))) /* Conversely, we know at compile time that the length is unsafe if the __L * __S <= __OBJSZ condition can be folded to a constant and if it is diff --git a/gl/lib/fcntl.in.h b/gl/lib/fcntl.in.h index 3e0c302a..9270ced8 100644 --- a/gl/lib/fcntl.in.h +++ b/gl/lib/fcntl.in.h @@ -435,6 +435,10 @@ _GL_WARN_ON_USE (openat, "openat is not portable - " # define AT_EACCESS 4 #endif +/* Ignore this flag if not supported. */ +#ifndef AT_NO_AUTOMOUNT +# define AT_NO_AUTOMOUNT 0 +#endif #endif /* _@GUARD_PREFIX@_FCNTL_H */ #endif /* _@GUARD_PREFIX@_FCNTL_H */ diff --git a/gl/lib/glob.c b/gl/lib/glob.c index f8d8a306..57cb3bd1 100644 --- a/gl/lib/glob.c +++ b/gl/lib/glob.c @@ -28,6 +28,7 @@ #include <glob.h> #include <errno.h> +#include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> #include <stdbool.h> @@ -56,6 +57,8 @@ # define sysconf(id) __sysconf (id) # define closedir(dir) __closedir (dir) # define opendir(name) __opendir (name) +# undef dirfd +# define dirfd(str) __dirfd (str) # define readdir(str) __readdir64 (str) # define getpwnam_r(name, bufp, buf, len, res) \ __getpwnam_r (name, bufp, buf, len, res) @@ -69,11 +72,8 @@ # ifndef GLOB_LSTAT # define GLOB_LSTAT gl_lstat # endif -# ifndef GLOB_STAT64 -# define GLOB_STAT64 __stat64 -# endif -# ifndef GLOB_LSTAT64 -# define GLOB_LSTAT64 __lstat64 +# ifndef GLOB_FSTATAT64 +# define GLOB_FSTATAT64 __fstatat64 # endif # include <shlib-compat.h> #else /* !_LIBC */ @@ -88,8 +88,7 @@ # define struct_stat struct stat # define struct_stat64 struct stat # define GLOB_LSTAT gl_lstat -# define GLOB_STAT64 stat -# define GLOB_LSTAT64 lstat +# define GLOB_FSTATAT64 fstatat #endif /* _LIBC */ #include <fnmatch.h> @@ -215,7 +214,8 @@ glob_lstat (glob_t *pglob, int flags, const char *fullname) } ust; return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC) ? pglob->GLOB_LSTAT (fullname, &ust.st) - : GLOB_LSTAT64 (fullname, &ust.st64)); + : GLOB_FSTATAT64 (AT_FDCWD, fullname, &ust.st64, + AT_SYMLINK_NOFOLLOW)); } /* Set *R = A + B. Return true if the answer is mathematically @@ -257,7 +257,8 @@ is_dir (char const *filename, int flags, glob_t const *pglob) struct_stat64 st64; return (__glibc_unlikely (flags & GLOB_ALTDIRFUNC) ? pglob->gl_stat (filename, &st) == 0 && S_ISDIR (st.st_mode) - : GLOB_STAT64 (filename, &st64) == 0 && S_ISDIR (st64.st_mode)); + : (GLOB_FSTATAT64 (AT_FDCWD, filename, &st64, 0) == 0 + && S_ISDIR (st64.st_mode))); } /* Find the end of the sub-pattern in a brace expression. */ @@ -1283,6 +1284,8 @@ glob_in_dir (const char *pattern, const char *directory, int flags, { size_t dirlen = strlen (directory); void *stream = NULL; + struct scratch_buffer s; + scratch_buffer_init (&s); # define GLOBNAMES_MEMBERS(nnames) \ struct globnames *next; size_t count; char *name[nnames]; struct globnames { GLOBNAMES_MEMBERS (FLEXIBLE_ARRAY_MEMBER) }; @@ -1354,6 +1357,8 @@ glob_in_dir (const char *pattern, const char *directory, int flags, } else { + DIR *dirp = stream; + int dfd = dirfd (dirp); int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)); flags |= GLOB_MAGCHAR; @@ -1381,8 +1386,32 @@ glob_in_dir (const char *pattern, const char *directory, int flags, if (flags & GLOB_ONLYDIR) switch (readdir_result_type (d)) { - case DT_DIR: case DT_LNK: case DT_UNKNOWN: break; default: continue; + case DT_DIR: break; + case DT_LNK: case DT_UNKNOWN: + /* The filesystem was too lazy to give us a hint, + so we have to do it the hard way. */ + if (__glibc_unlikely (dfd < 0 || flags & GLOB_ALTDIRFUNC)) + { + size_t namelen = strlen (d.name); + size_t need = dirlen + 1 + namelen + 1; + if (s.length < need + && !scratch_buffer_set_array_size (&s, need, 1)) + goto memory_error; + char *p = mempcpy (s.data, directory, dirlen); + *p = '/'; + p += p[-1] != '/'; + memcpy (p, d.name, namelen + 1); + if (! is_dir (s.data, flags, pglob)) + continue; + } + else + { + struct_stat64 st64; + if (! (GLOB_FSTATAT64 (dfd, d.name, &st64, 0) == 0 + && S_ISDIR (st64.st_mode))) + continue; + } } if (fnmatch (pattern, d.name, fnm_flags) == 0) @@ -1514,5 +1543,6 @@ glob_in_dir (const char *pattern, const char *directory, int flags, __set_errno (save); } + scratch_buffer_free (&s); return result; } diff --git a/gl/lib/lchown.c b/gl/lib/lchown.c index 105c2d99..8b0d871a 100644 --- a/gl/lib/lchown.c +++ b/gl/lib/lchown.c @@ -45,9 +45,9 @@ lchown (const char *file, uid_t uid, gid_t gid) { # if HAVE_CHOWN # if ! CHOWN_MODIFIES_SYMLINK - struct stat stats; + char readlink_buf[1]; - if (lstat (file, &stats) == 0 && S_ISLNK (stats.st_mode)) + if (0 <= readlink (file, readlink_buf, sizeof readlink_buf)) { errno = EOPNOTSUPP; return -1; diff --git a/gl/lib/libc-config.h b/gl/lib/libc-config.h index 8fec4893..a56665b1 100644 --- a/gl/lib/libc-config.h +++ b/gl/lib/libc-config.h @@ -121,6 +121,7 @@ # undef __attr_dealloc # undef __attr_dealloc_free # undef __attribute__ +# undef __attribute_alloc_align__ # undef __attribute_alloc_size__ # undef __attribute_artificial__ # undef __attribute_const__ @@ -129,6 +130,7 @@ # undef __attribute_format_arg__ # undef __attribute_format_strfmon__ # undef __attribute_malloc__ +# undef __attribute_maybe_unused__ # undef __attribute_noinline__ # undef __attribute_nonstring__ # undef __attribute_pure__ @@ -142,16 +144,24 @@ # undef __extern_always_inline # undef __extern_inline # undef __flexarr +# undef __fortified_attr_access # undef __fortify_function # undef __glibc_c99_flexarr_available +# undef __glibc_fortify +# undef __glibc_fortify_n # undef __glibc_has_attribute # undef __glibc_has_builtin # undef __glibc_has_extension +# undef __glibc_likely # undef __glibc_macro_warning # undef __glibc_macro_warning1 # undef __glibc_objsize # undef __glibc_objsize0 +# undef __glibc_safe_len_cond +# undef __glibc_safe_or_unknown_len # undef __glibc_unlikely +# undef __glibc_unsafe_len +# undef __glibc_unsigned_or_positive # undef __inline # undef __ptr_t # undef __restrict @@ -159,6 +169,7 @@ # undef __va_arg_pack # undef __va_arg_pack_len # undef __warnattr +# undef __wur /* Include our copy of glibc <sys/cdefs.h>. */ # include <cdefs.h> diff --git a/gl/lib/openat.h b/gl/lib/openat.h index 5c8ff90b..56919ef8 100644 --- a/gl/lib/openat.h +++ b/gl/lib/openat.h @@ -98,12 +98,14 @@ lchmodat (int fd, char const *file, mode_t mode) # define STATAT_INLINE _GL_INLINE # endif +_GL_ATTRIBUTE_DEPRECATED STATAT_INLINE int statat (int fd, char const *name, struct stat *st) { return fstatat (fd, name, st, 0); } +_GL_ATTRIBUTE_DEPRECATED STATAT_INLINE int lstatat (int fd, char const *name, struct stat *st) { diff --git a/gl/lib/readlinkat.c b/gl/lib/readlinkat.c new file mode 100644 index 00000000..ab45e140 --- /dev/null +++ b/gl/lib/readlinkat.c @@ -0,0 +1,113 @@ +/* Read a symlink relative to an open directory. + Copyright (C) 2009-2022 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +/* written by Eric Blake */ + +#include <config.h> + +/* Specification. */ +#include <unistd.h> + +#include <errno.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> + +#if HAVE_READLINKAT + +# undef fstatat +# undef readlinkat + +ssize_t +rpl_readlinkat (int fd, char const *file, char *buf, size_t bufsize) +{ +# if READLINK_TRAILING_SLASH_BUG + size_t file_len = strlen (file); + if (file_len && file[file_len - 1] == '/') + { + /* Even if FILE without the slash is a symlink to a directory, + both lstat() and stat() must resolve the trailing slash to + the directory rather than the symlink. We can therefore + safely use fstatat(..., 0) to distinguish between EINVAL and + ENOTDIR/ENOENT, avoiding extra overhead of rpl_fstatat(). */ + struct stat st; + if (fstatat (fd, file, &st, 0) == 0 || errno == EOVERFLOW) + errno = EINVAL; + return -1; + } +# endif /* READLINK_TRAILING_SLASH_BUG */ + + ssize_t r = readlinkat (fd, file, buf, bufsize); + +# if READLINK_TRUNCATE_BUG + if (r < 0 && errno == ERANGE) + { + /* Try again with a bigger buffer. This is just for test cases; + real code invariably discards short reads. */ + char stackbuf[4032]; + r = readlinkat (fd, file, stackbuf, sizeof stackbuf); + if (r < 0) + { + if (errno == ERANGE) + { + /* Clear the buffer, which is good enough for real code. + Thankfully, no test cases try short reads of enormous + symlinks and what would be the point anyway? */ + r = bufsize; + memset (buf, 0, r); + } + } + else + { + if (bufsize < r) + r = bufsize; + memcpy (buf, stackbuf, r); + } + } +# endif + + return r; +} + +#else + +/* Gnulib provides a readlink stub for mingw; use it for distinction + between EINVAL and ENOENT, rather than always failing with ENOSYS. */ + +/* POSIX 2008 says that unlike readlink, readlinkat returns 0 for + success instead of the buffer length. But this would render + readlinkat worthless since readlink does not guarantee a + NUL-terminated buffer. Assume this was a bug in POSIX. */ + +/* Read the contents of symlink FILE into buffer BUF of size BUFSIZE, in the + directory open on descriptor FD. If possible, do it without changing + the working directory. Otherwise, resort to using save_cwd/fchdir, + then readlink/restore_cwd. If either the save_cwd or the restore_cwd + fails, then give a diagnostic and exit nonzero. */ + +# define AT_FUNC_NAME readlinkat +# define AT_FUNC_F1 readlink +# define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t bufsize +# define AT_FUNC_POST_FILE_ARGS , buf, bufsize +# define AT_FUNC_RESULT ssize_t +# include "at-func.c" +# undef AT_FUNC_NAME +# undef AT_FUNC_F1 +# undef AT_FUNC_POST_FILE_PARAM_DECLS +# undef AT_FUNC_POST_FILE_ARGS +# undef AT_FUNC_RESULT + +#endif diff --git a/gl/lib/regcomp.c b/gl/lib/regcomp.c index b607c853..122c3de5 100644 --- a/gl/lib/regcomp.c +++ b/gl/lib/regcomp.c @@ -2038,15 +2038,25 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax) } switch (c) { - case '-': - token->type = OP_CHARSET_RANGE; - break; case ']': token->type = OP_CLOSE_BRACKET; break; case '^': token->type = OP_NON_MATCH_LIST; break; + case '-': + /* In V7 Unix grep and Unix awk and mawk, [...---...] + (3 adjacent minus signs) stands for a single minus sign. + Support that without breaking anything else. */ + if (! (re_string_cur_idx (input) + 2 < re_string_length (input) + && re_string_peek_byte (input, 1) == '-' + && re_string_peek_byte (input, 2) == '-')) + { + token->type = OP_CHARSET_RANGE; + break; + } + re_string_skip_bytes (input, 2); + FALLTHROUGH; default: token->type = CHARACTER; } diff --git a/gl/lib/regex_internal.c b/gl/lib/regex_internal.c index 3945ee7e..0e6919f3 100644 --- a/gl/lib/regex_internal.c +++ b/gl/lib/regex_internal.c @@ -1396,24 +1396,22 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token) if (__glibc_unlikely (new_nodes == NULL)) return -1; dfa->nodes = new_nodes; + dfa->nodes_alloc = new_nodes_alloc; new_nexts = re_realloc (dfa->nexts, Idx, new_nodes_alloc); + if (new_nexts != NULL) + dfa->nexts = new_nexts; new_indices = re_realloc (dfa->org_indices, Idx, new_nodes_alloc); + if (new_indices != NULL) + dfa->org_indices = new_indices; new_edests = re_realloc (dfa->edests, re_node_set, new_nodes_alloc); + if (new_edests != NULL) + dfa->edests = new_edests; new_eclosures = re_realloc (dfa->eclosures, re_node_set, new_nodes_alloc); + if (new_eclosures != NULL) + dfa->eclosures = new_eclosures; if (__glibc_unlikely (new_nexts == NULL || new_indices == NULL || new_edests == NULL || new_eclosures == NULL)) - { - re_free (new_nexts); - re_free (new_indices); - re_free (new_edests); - re_free (new_eclosures); - return -1; - } - dfa->nexts = new_nexts; - dfa->org_indices = new_indices; - dfa->edests = new_edests; - dfa->eclosures = new_eclosures; - dfa->nodes_alloc = new_nodes_alloc; + return -1; } dfa->nodes[dfa->nodes_len] = token; dfa->nodes[dfa->nodes_len].constraint = 0; diff --git a/gl/lib/regexec.c b/gl/lib/regexec.c index aea1e7da..521cb028 100644 --- a/gl/lib/regexec.c +++ b/gl/lib/regexec.c @@ -1308,8 +1308,8 @@ push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node, re_node_set *eps_via_nodes) { reg_errcode_t err; - Idx num = fs->num++; - if (fs->num == fs->alloc) + Idx num = fs->num; + if (num == fs->alloc) { struct re_fail_stack_ent_t *new_array; new_array = re_realloc (fs->stack, struct re_fail_stack_ent_t, @@ -1324,6 +1324,7 @@ push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node, fs->stack[num].regs = re_malloc (regmatch_t, 2 * nregs); if (fs->stack[num].regs == NULL) return REG_ESPACE; + fs->num = num + 1; memcpy (fs->stack[num].regs, regs, sizeof (regmatch_t) * nregs); memcpy (fs->stack[num].regs + nregs, prevregs, sizeof (regmatch_t) * nregs); err = re_node_set_init_copy (&fs->stack[num].eps_via_nodes, eps_via_nodes); diff --git a/gl/lib/renameatu.c b/gl/lib/renameatu.c index 0eb33ab6..7ba186ca 100644 --- a/gl/lib/renameatu.c +++ b/gl/lib/renameatu.c @@ -133,12 +133,13 @@ renameatu (int fd1, char const *src, int fd2, char const *dst, break; case RENAME_NOREPLACE: - /* This has a race between the call to lstatat and the calls to - renameat below. This lstatat is needed even if RENAME_EXCL + /* This has a race between the call to fstatat and the calls to + renameat below. This fstatat is needed even if RENAME_EXCL is defined, because RENAME_EXCL is buggy on macOS 11.2: renameatx_np (fd, "X", fd, "X", RENAME_EXCL) incorrectly succeeds when X exists. */ - if (lstatat (fd2, dst, &dst_st) == 0 || errno == EOVERFLOW) + if (fstatat (fd2, dst, &dst_st, AT_SYMLINK_NOFOLLOW) == 0 + || errno == EOVERFLOW) return errno_fail (EEXIST); if (errno != ENOENT) return -1; @@ -164,14 +165,14 @@ renameatu (int fd1, char const *src, int fd2, char const *dst, the source does not exist, or if the destination cannot be turned into a directory, give up now. Otherwise, strip trailing slashes before calling rename. */ - if (lstatat (fd1, src, &src_st)) + if (fstatat (fd1, src, &src_st, AT_SYMLINK_NOFOLLOW)) return -1; if (dst_found_nonexistent) { if (!S_ISDIR (src_st.st_mode)) return errno_fail (ENOENT); } - else if (lstatat (fd2, dst, &dst_st)) + else if (fstatat (fd2, dst, &dst_st, AT_SYMLINK_NOFOLLOW)) { if (errno != ENOENT || !S_ISDIR (src_st.st_mode)) return -1; @@ -196,7 +197,7 @@ renameatu (int fd1, char const *src, int fd2, char const *dst, goto out; } strip_trailing_slashes (src_temp); - if (lstatat (fd1, src_temp, &src_st)) + if (fstatat (fd1, src_temp, &src_st, AT_SYMLINK_NOFOLLOW)) { rename_errno = errno; goto out; @@ -213,15 +214,16 @@ renameatu (int fd1, char const *src, int fd2, char const *dst, goto out; } strip_trailing_slashes (dst_temp); - if (lstatat (fd2, dst_temp, &dst_st)) + char readlink_buf[1]; + if (readlinkat (fd2, dst_temp, readlink_buf, sizeof readlink_buf) < 0) { - if (errno != ENOENT) + if (errno != ENOENT && errno != EINVAL) { rename_errno = errno; goto out; } } - else if (S_ISLNK (dst_st.st_mode)) + else goto out; } # endif /* RENAME_TRAILING_SLASH_SOURCE_BUG */ diff --git a/gl/lib/statat.c b/gl/lib/statat.c deleted file mode 100644 index bf96d3b4..00000000 --- a/gl/lib/statat.c +++ /dev/null @@ -1,21 +0,0 @@ -/* Return info about a file at a directory. - - Copyright (C) 2012-2022 Free Software Foundation, Inc. - - This file is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published - by the Free Software Foundation, either version 3 of the License, - or (at your option) any later version. - - This file is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <https://www.gnu.org/licenses/>. */ - -#include <config.h> - -#define STATAT_INLINE _GL_EXTERN_INLINE -#include "openat.h" diff --git a/gl/lib/stdlib.in.h b/gl/lib/stdlib.in.h index d52c2f79..a86643c3 100644 --- a/gl/lib/stdlib.in.h +++ b/gl/lib/stdlib.in.h @@ -184,7 +184,11 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - " # undef free # define free rpl_free # endif +# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) +_GL_FUNCDECL_RPL (free, void, (void *ptr) throw ()); +# else _GL_FUNCDECL_RPL (free, void, (void *ptr)); +# endif _GL_CXXALIAS_RPL (free, void, (void *ptr)); # else _GL_CXXALIAS_SYS (free, void, (void *ptr)); diff --git a/gl/lib/stpcpy.c b/gl/lib/stpcpy.c new file mode 100644 index 00000000..434f84ae --- /dev/null +++ b/gl/lib/stpcpy.c @@ -0,0 +1,49 @@ +/* stpcpy.c -- copy a string and return pointer to end of new string + Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2022 Free Software + Foundation, Inc. + + NOTE: The canonical source of this file is maintained with the GNU C Library. + Bugs can be reported to bug-glibc@prep.ai.mit.edu. + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include <string.h> + +#undef __stpcpy +#ifdef _LIBC +# undef stpcpy +#endif + +#ifndef weak_alias +# define __stpcpy stpcpy +#endif + +/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ +char * +__stpcpy (char *dest, const char *src) +{ + register char *d = dest; + register const char *s = src; + + do + *d++ = *s; + while (*s++ != '\0'); + + return d - 1; +} +#ifdef weak_alias +weak_alias (__stpcpy, stpcpy) +#endif diff --git a/gl/lib/str-two-way.h b/gl/lib/str-two-way.h index 7ee344ae..b00017c0 100644 --- a/gl/lib/str-two-way.h +++ b/gl/lib/str-two-way.h @@ -231,7 +231,7 @@ critical_factorization (const unsigned char *needle, size_t needle_len, most 2 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching. */ -static RETURN_TYPE +static RETURN_TYPE _GL_ATTRIBUTE_PURE two_way_short_needle (const unsigned char *haystack, size_t haystack_len, const unsigned char *needle, size_t needle_len) { @@ -325,7 +325,7 @@ two_way_short_needle (const unsigned char *haystack, size_t haystack_len, If AVAILABLE modifies HAYSTACK_LEN (as in strstr), then at most 3 * HAYSTACK_LEN - NEEDLE_LEN comparisons occur in searching, and sublinear performance is not possible. */ -static RETURN_TYPE +static RETURN_TYPE _GL_ATTRIBUTE_PURE two_way_long_needle (const unsigned char *haystack, size_t haystack_len, const unsigned char *needle, size_t needle_len) { diff --git a/gl/lib/string.in.h b/gl/lib/string.in.h index c9432948..3996da9f 100644 --- a/gl/lib/string.in.h +++ b/gl/lib/string.in.h @@ -122,17 +122,33 @@ _GL_EXTERN_C void rpl_free (void *); # undef _GL_ATTRIBUTE_DEALLOC_FREE # define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1) # else -# if defined _MSC_VER -_GL_EXTERN_C void __cdecl free (void *); +# if defined _MSC_VER && !defined free +_GL_EXTERN_C +# if defined _DLL + __declspec (dllimport) +# endif + void __cdecl free (void *); # else +# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) +_GL_EXTERN_C void free (void *) throw (); +# else _GL_EXTERN_C void free (void *); +# endif # endif # endif #else -# if defined _MSC_VER -_GL_EXTERN_C void __cdecl free (void *); +# if defined _MSC_VER && !defined free +_GL_EXTERN_C +# if defined _DLL + __declspec (dllimport) +# endif + void __cdecl free (void *); # else +# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) +_GL_EXTERN_C void free (void *) throw (); +# else _GL_EXTERN_C void free (void *); +# endif # endif #endif @@ -230,10 +246,11 @@ _GL_CXXALIAS_SYS_CAST2 (memchr, void const *, (void const *__s, int __c, size_t __n)); # endif # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n) throw ()); _GL_CXXALIASWARN1 (memchr, void const *, - (void const *__s, int __c, size_t __n)); + (void const *__s, int __c, size_t __n) throw ()); # elif __GLIBC__ >= 2 _GL_CXXALIASWARN (memchr); # endif @@ -315,9 +332,10 @@ _GL_CXXALIAS_SYS_CAST2 (memrchr, void *, (void const *, int, size_t), void const *, (void const *, int, size_t)); # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t)); -_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t) throw ()); +_GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t) throw ()); # else _GL_CXXALIASWARN (memrchr); # endif @@ -345,9 +363,11 @@ _GL_CXXALIAS_SYS_CAST2 (rawmemchr, void *, (void const *__s, int __c_in), void const *, (void const *__s, int __c_in)); # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in)); -_GL_CXXALIASWARN1 (rawmemchr, void const *, (void const *__s, int __c_in)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (rawmemchr, void *, (void *__s, int __c_in) throw ()); +_GL_CXXALIASWARN1 (rawmemchr, void const *, + (void const *__s, int __c_in) throw ()); # else _GL_CXXALIASWARN (rawmemchr); # endif @@ -449,9 +469,11 @@ _GL_CXXALIAS_SYS_CAST2 (strchrnul, char const *, (char const *__s, int __c_in)); # endif # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in)); -_GL_CXXALIASWARN1 (strchrnul, char const *, (char const *__s, int __c_in)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in) throw ()); +_GL_CXXALIASWARN1 (strchrnul, char const *, + (char const *__s, int __c_in) throw ()); # else _GL_CXXALIASWARN (strchrnul); # endif @@ -569,7 +591,7 @@ _GL_FUNCDECL_RPL (strndup, char *, _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC_FREE); _GL_CXXALIAS_RPL (strndup, char *, (char const *__s, size_t __n)); # else -# if !@HAVE_DECL_STRNDUP@ || __GNUC__ >= 11 +# if !@HAVE_DECL_STRNDUP@ || (__GNUC__ >= 11 && !defined strndup) _GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n) _GL_ARG_NONNULL ((1)) @@ -579,7 +601,7 @@ _GL_CXXALIAS_SYS (strndup, char *, (char const *__s, size_t __n)); # endif _GL_CXXALIASWARN (strndup); #else -# if __GNUC__ >= 11 +# if __GNUC__ >= 11 && !defined strndup /* For -Wmismatched-dealloc: Associate strndup with free or rpl_free. */ _GL_FUNCDECL_SYS (strndup, char *, (char const *__s, size_t __n) @@ -651,10 +673,11 @@ _GL_CXXALIAS_SYS_CAST2 (strpbrk, char *, (char const *__s, char const *__accept), const char *, (char const *__s, char const *__accept)); # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept) throw ()); _GL_CXXALIASWARN1 (strpbrk, char const *, - (char const *__s, char const *__accept)); + (char const *__s, char const *__accept) throw ()); # elif __GLIBC__ >= 2 _GL_CXXALIASWARN (strpbrk); # endif @@ -759,10 +782,12 @@ _GL_CXXALIAS_SYS_CAST2 (strstr, const char *, (const char *haystack, const char *needle)); # endif # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (strstr, char *, + (char *haystack, const char *needle) throw ()); _GL_CXXALIASWARN1 (strstr, const char *, - (const char *haystack, const char *needle)); + (const char *haystack, const char *needle) throw ()); # elif __GLIBC__ >= 2 _GL_CXXALIASWARN (strstr); # endif @@ -808,10 +833,12 @@ _GL_CXXALIAS_SYS_CAST2 (strcasestr, const char *, (const char *haystack, const char *needle)); # endif # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \ - && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) -_GL_CXXALIASWARN1 (strcasestr, char *, (char *haystack, const char *needle)); + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) \ + || defined __clang__) +_GL_CXXALIASWARN1 (strcasestr, char *, + (char *haystack, const char *needle) throw ()); _GL_CXXALIASWARN1 (strcasestr, const char *, - (const char *haystack, const char *needle)); + (const char *haystack, const char *needle) throw ()); # else _GL_CXXALIASWARN (strcasestr); # endif diff --git a/gl/lib/sys_stat.in.h b/gl/lib/sys_stat.in.h index 28ddd42f..714c3cb1 100644 --- a/gl/lib/sys_stat.in.h +++ b/gl/lib/sys_stat.in.h @@ -391,7 +391,33 @@ struct stat #endif -#if @GNULIB_MDA_CHMOD@ +#if @GNULIB_CHMOD@ +# if @REPLACE_CHMOD@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chmod +# define chmod rpl_chmod +# endif +_GL_FUNCDECL_RPL (chmod, int, (const char *filename, mode_t mode) + _GL_ARG_NONNULL ((1))); +_GL_CXXALIAS_RPL (chmod, int, (const char *filename, mode_t mode)); +# elif defined _WIN32 && !defined __CYGWIN__ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef chmod +# define chmod _chmod +# endif +/* Need to cast, because in mingw the last argument is 'int mode'. */ +_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode)); +# else +_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode)); +# endif +_GL_CXXALIASWARN (chmod); +#elif defined GNULIB_POSIXCHECK +# undef chmod +# if HAVE_RAW_DECL_CHMOD +_GL_WARN_ON_USE (chmod, "chmod has portability problems - " + "use gnulib module chmod for portability"); +# endif +#elif @GNULIB_MDA_CHMOD@ /* On native Windows, map 'chmod' to '_chmod', so that -loldnames is not required. In C++ with GNULIB_NAMESPACE, avoid differences between platforms by defining GNULIB_NAMESPACE::chmod always. */ diff --git a/gl/lib/termios.in.h b/gl/lib/termios.in.h new file mode 100644 index 00000000..32b7c5b3 --- /dev/null +++ b/gl/lib/termios.in.h @@ -0,0 +1,73 @@ +/* Substitute for and wrapper around <termios.h>. + Copyright (C) 2010-2022 Free Software Foundation, Inc. + + This file is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of the + License, or (at your option) any later version. + + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. */ + +#ifndef _@GUARD_PREFIX@_TERMIOS_H + +#if __GNUC__ >= 3 +@PRAGMA_SYSTEM_HEADER@ +#endif +@PRAGMA_COLUMNS@ + +/* On HP-UX 11.00, some of the function declarations in <sys/termio.h>, + included by <termios.h>, are not protected by extern "C". Enforce + "C" linkage for these functions nevertheless. */ +#if defined __hpux && defined __cplusplus +# include <sys/types.h> +# include <sys/ioctl.h> +extern "C" { +# include <sys/termio.h> +} +#endif + +/* The include_next requires a split double-inclusion guard. */ +#if @HAVE_TERMIOS_H@ +# @INCLUDE_NEXT@ @NEXT_TERMIOS_H@ +#endif + +#ifndef _@GUARD_PREFIX@_TERMIOS_H +#define _@GUARD_PREFIX@_TERMIOS_H + +/* Get pid_t. */ +#include <sys/types.h> + +/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ + +/* The definition of _GL_WARN_ON_USE is copied here. */ + + +/* Declare overridden functions. */ + +#if @GNULIB_TCGETSID@ +/* Return the session ID of the controlling terminal of the current process. + The argument is a descriptor if this controlling terminal. + Return -1, with errno set, upon failure. errno = ENOSYS means that the + function is unsupported. */ +# if !@HAVE_DECL_TCGETSID@ +_GL_FUNCDECL_SYS (tcgetsid, pid_t, (int fd)); +# endif +_GL_CXXALIAS_SYS (tcgetsid, pid_t, (int fd)); +_GL_CXXALIASWARN (tcgetsid); +#elif defined GNULIB_POSIXCHECK +# undef tcgetsid +# if HAVE_RAW_DECL_TCGETSID +_GL_WARN_ON_USE (tcgetsid, "tcgetsid is not portable - " + "use gnulib module tcgetsid for portability"); +# endif +#endif + + +#endif /* _@GUARD_PREFIX@_TERMIOS_H */ +#endif /* _@GUARD_PREFIX@_TERMIOS_H */ diff --git a/gl/lib/unlinkat.c b/gl/lib/unlinkat.c index eae60074..c9ff3ab2 100644 --- a/gl/lib/unlinkat.c +++ b/gl/lib/unlinkat.c @@ -58,7 +58,7 @@ rpl_unlinkat (int fd, char const *name, int flag) rule of letting unlink("link-to-dir/") attempt to unlink a directory. */ struct stat st; - result = lstatat (fd, name, &st); + result = fstatat (fd, name, &st, AT_SYMLINK_NOFOLLOW); if (result == 0 || errno == EOVERFLOW) { /* Trailing NUL will overwrite the trailing slash. */ @@ -71,7 +71,8 @@ rpl_unlinkat (int fd, char const *name, int flag) memcpy (short_name, name, len); while (len && ISSLASH (short_name[len - 1])) short_name[--len] = '\0'; - if (len && (lstatat (fd, short_name, &st) || S_ISLNK (st.st_mode))) + if (len && (fstatat (fd, short_name, &st, AT_SYMLINK_NOFOLLOW) + || S_ISLNK (st.st_mode))) { free (short_name); errno = EPERM; diff --git a/gl/lib/vasnprintf.c b/gl/lib/vasnprintf.c index 48574524..285c674b 100644 --- a/gl/lib/vasnprintf.c +++ b/gl/lib/vasnprintf.c @@ -915,8 +915,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q) q_ptr[q_len++] = 1; } keep_q: - if (tmp_roomptr != NULL) - free (tmp_roomptr); + free (tmp_roomptr); q->limbs = q_ptr; q->nlimbs = q_len; return roomptr; @@ -1873,11 +1872,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, free (a.arg); if (PRINTF_FETCHARGS (args, &a) < 0) - { - CLEANUP (); - errno = EINVAL; - return NULL; - } + goto fail_1_with_EINVAL; { size_t buf_neededlength; @@ -1913,19 +1908,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, buf_malloced = buf; } - if (resultbuf != NULL) - { - result = resultbuf; - allocated = *lengthp; - } - else - { - result = NULL; - allocated = 0; - } + result = resultbuf; + allocated = (resultbuf != NULL ? *lengthp : 0); length = 0; /* Invariants: - result is either == resultbuf or == NULL or malloc-allocated. + result is either == resultbuf or malloc-allocated. + If result == NULL, resultbuf is == NULL as well. If length > 0, then result != NULL. */ /* Ensures that allocated >= needed. Aborts through a jump to @@ -1942,7 +1930,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, memory_size = xtimes (allocated, sizeof (DCHAR_T)); \ if (size_overflow_p (memory_size)) \ oom_statement \ - if (result == resultbuf || result == NULL) \ + if (result == resultbuf) \ memory = (DCHAR_T *) malloc (memory_size); \ else \ memory = (DCHAR_T *) realloc (result, memory_size); \ @@ -2112,15 +2100,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (count == 0) break; if (count < 0) - { - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - errno = EILSEQ; - return NULL; - } + goto fail_with_EILSEQ; arg_end += count; characters++; } @@ -2137,15 +2117,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (count == 0) break; if (count < 0) - { - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - errno = EILSEQ; - return NULL; - } + goto fail_with_EILSEQ; arg_end += count; characters++; } @@ -2191,14 +2163,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, converted, &converted_len); # endif if (converted == NULL) - { - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - return NULL; - } + goto fail_with_errno; if (converted != result + length) { ENSURE_ALLOCATION_ELSE (xsum (length, converted_len), @@ -2237,15 +2202,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (count == 0) break; if (count < 0) - { - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - errno = EILSEQ; - return NULL; - } + goto fail_with_EILSEQ; arg_end += count; characters++; } @@ -2262,15 +2219,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (count == 0) break; if (count < 0) - { - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - errno = EILSEQ; - return NULL; - } + goto fail_with_EILSEQ; arg_end += count; characters++; } @@ -2316,14 +2265,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, converted, &converted_len); # endif if (converted == NULL) - { - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - return NULL; - } + goto fail_with_errno; if (converted != result + length) { ENSURE_ALLOCATION_ELSE (xsum (length, converted_len), @@ -2362,15 +2304,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (count == 0) break; if (count < 0) - { - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - errno = EILSEQ; - return NULL; - } + goto fail_with_EILSEQ; arg_end += count; characters++; } @@ -2387,15 +2321,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (count == 0) break; if (count < 0) - { - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - errno = EILSEQ; - return NULL; - } + goto fail_with_EILSEQ; arg_end += count; characters++; } @@ -2441,14 +2367,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, converted, &converted_len); # endif if (converted == NULL) - { - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - return NULL; - } + goto fail_with_errno; if (converted != result + length) { ENSURE_ALLOCATION_ELSE (xsum (length, converted_len), @@ -2590,16 +2509,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* Found the terminating NUL. */ break; if (count < 0) - { - /* Invalid or incomplete multibyte character. */ - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - errno = EILSEQ; - return NULL; - } + /* Invalid or incomplete multibyte character. */ + goto fail_with_EILSEQ; arg_end += count; characters++; } @@ -2626,16 +2537,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, /* Found the terminating NUL. */ break; if (count < 0) - { - /* Invalid or incomplete multibyte character. */ - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - errno = EILSEQ; - return NULL; - } + /* Invalid or incomplete multibyte character. */ + goto fail_with_EILSEQ; arg_end += count; characters++; } @@ -2752,16 +2655,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, break; count = local_wcrtomb (cbuf, *arg_end, &state); if (count < 0) - { - /* Cannot convert. */ - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - errno = EILSEQ; - return NULL; - } + /* Cannot convert. */ + goto fail_with_EILSEQ; if (precision < (unsigned int) count) break; arg_end++; @@ -2793,16 +2688,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, break; count = local_wcrtomb (cbuf, *arg_end, &state); if (count < 0) - { - /* Cannot convert. */ - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - errno = EILSEQ; - return NULL; - } + /* Cannot convert. */ + goto fail_with_EILSEQ; arg_end++; characters += count; } @@ -2859,12 +2746,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, if (tmpdst == NULL) { free (tmpsrc); - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - return NULL; + goto fail_with_errno; } free (tmpsrc); # endif @@ -2938,16 +2820,8 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, abort (); count = local_wcrtomb (cbuf, *arg, &state); if (count <= 0) - { - /* Cannot convert. */ - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - errno = EILSEQ; - return NULL; - } + /* Cannot convert. */ + goto fail_with_EILSEQ; ENSURE_ALLOCATION (xsum (length, count)); memcpy (result + length, cbuf, count); length += count; @@ -3083,14 +2957,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, NULL, NULL, &tmpdst_len); if (tmpdst == NULL) - { - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - return NULL; - } + goto fail_with_errno; # endif if (has_width) @@ -5463,13 +5330,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, errno = EINVAL; } - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - - return NULL; + goto fail_with_errno; } #if USE_SNPRINTF @@ -5603,14 +5464,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, NULL, NULL, &tmpdst_len); if (tmpdst == NULL) - { - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); - return NULL; - } + goto fail_with_errno; ENSURE_ALLOCATION_ELSE (xsum (length, tmpdst_len), { free (tmpdst); goto out_of_memory; }); DCHAR_CPY (result + length, tmpdst, tmpdst_len); @@ -5835,25 +5689,40 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, #if USE_SNPRINTF overflow: - if (!(result == resultbuf || result == NULL)) - free (result); - if (buf_malloced != NULL) - free (buf_malloced); - CLEANUP (); errno = EOVERFLOW; - return NULL; + goto fail_with_errno; #endif out_of_memory: - if (!(result == resultbuf || result == NULL)) + errno = ENOMEM; + goto fail_with_errno; + +#if ENABLE_UNISTDIO || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) + fail_with_EILSEQ: + errno = EILSEQ; + goto fail_with_errno; +#endif + + fail_with_errno: + if (result != resultbuf) free (result); if (buf_malloced != NULL) free (buf_malloced); - out_of_memory_1: CLEANUP (); - errno = ENOMEM; return NULL; } + + out_of_memory_1: + errno = ENOMEM; + goto fail_1_with_errno; + + fail_1_with_EINVAL: + errno = EINVAL; + goto fail_1_with_errno; + + fail_1_with_errno: + CLEANUP (); + return NULL; } #undef MAX_ROOM_NEEDED diff --git a/gl/lib/verify.h b/gl/lib/verify.h index 07b2f486..c5c63ae9 100644 --- a/gl/lib/verify.h +++ b/gl/lib/verify.h @@ -34,7 +34,7 @@ #ifndef __cplusplus # if (201112L <= __STDC_VERSION__ \ || (!defined __STRICT_ANSI__ \ - && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 4 <= __clang_major__))) + && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 5 <= __clang_major__))) # define _GL_HAVE__STATIC_ASSERT 1 # endif # if (202000L <= __STDC_VERSION__ \ @@ -215,6 +215,9 @@ template <int w> # define _GL_VERIFY(R, DIAGNOSTIC, ...) \ extern int (*_GL_GENSYM (_gl_verify_function) (void)) \ [_GL_VERIFY_TRUE (R, DIAGNOSTIC)] +# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +# pragma GCC diagnostic ignored "-Wnested-externs" +# endif #endif /* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h. */ diff --git a/gl/lib/wchar.in.h b/gl/lib/wchar.in.h index d7792e5f..835ddbe6 100644 --- a/gl/lib/wchar.in.h +++ b/gl/lib/wchar.in.h @@ -185,17 +185,33 @@ _GL_EXTERN_C void rpl_free (void *); # undef _GL_ATTRIBUTE_DEALLOC_FREE # define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1) # else -# if defined _MSC_VER -_GL_EXTERN_C void __cdecl free (void *); +# if defined _MSC_VER && !defined free +_GL_EXTERN_C +# if defined _DLL + __declspec (dllimport) +# endif + void __cdecl free (void *); # else +# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) +_GL_EXTERN_C void free (void *) throw (); +# else _GL_EXTERN_C void free (void *); +# endif # endif # endif #else -# if defined _MSC_VER -_GL_EXTERN_C void __cdecl free (void *); +# if defined _MSC_VER && !defined free +_GL_EXTERN_C +# if defined _DLL + __declspec (dllimport) +# endif + void __cdecl free (void *); # else +# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) +_GL_EXTERN_C void free (void *) throw (); +# else _GL_EXTERN_C void free (void *); +# endif # endif #endif |