Skip to content

Commit

Permalink
Drop now redundant bundled copies of stpcpy() and stpncpy()
Browse files Browse the repository at this point in the history
stpcpy() and stpncpy() got added to POSIX-1.2008 (surprisingly if you
ask me), and as that's the version we require now since commit
96ec957, we don't need to carry this
dusty stuff (only touched once since -98...)
  • Loading branch information
pmatilai committed May 4, 2022
1 parent f7ffa9c commit 610209e
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 166 deletions.
4 changes: 1 addition & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -602,15 +602,13 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([extern const char *__progname;],
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no]))

AC_REPLACE_FUNCS(stpcpy stpncpy)

AC_CHECK_FUNCS([secure_getenv __secure_getenv])

AC_CHECK_FUNCS(
[mkstemp getcwd basename dirname realpath setenv unsetenv regcomp lchown \
utimes getline localtime_r statvfs getaddrinfo \
openat mkdirat fstatat linkat symlinkat mkfifoat mknodat unlinkat \
renameat utimensat fchmodat fchownat ],
renameat utimensat fchmodat fchownat stpcpy stpncpy ],
[], [AC_MSG_ERROR([function required by rpm])])

dnl check if python is requested
Expand Down
3 changes: 0 additions & 3 deletions misc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_srcdir)/include
AM_CPPFLAGS += -I$(top_srcdir)/misc

EXTRA_DIST = \
stpcpy.c stpncpy.c

noinst_LTLIBRARIES = libmisc.la

libmisc_la_SOURCES = fts.c rpmfts.h
Expand Down
51 changes: 0 additions & 51 deletions misc/stpcpy.c

This file was deleted.

101 changes: 0 additions & 101 deletions misc/stpncpy.c

This file was deleted.

8 changes: 0 additions & 8 deletions system.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ extern char ** environ;
#endif
#endif

#if !defined(HAVE_STPCPY)
char * stpcpy(char * dest, const char * src);
#endif

#if !defined(HAVE_STPNCPY)
char * stpncpy(char * dest, const char * src, size_t n);
#endif

#if HAVE_SECURE_GETENV
#define getenv(_s) secure_getenv(_s)
#elif HAVE___SECURE_GETENV
Expand Down

0 comments on commit 610209e

Please sign in to comment.