summaryrefslogtreecommitdiff
path: root/sed
diff options
context:
space:
mode:
authorClint Adams <clint@debian.org>2013-05-09 01:03:12 -0400
committerClint Adams <clint@debian.org>2013-05-09 01:03:12 -0400
commitd75f3c567505ad7acd2c1943207b367593652739 (patch)
treee519be160770e6b20bfe88eb923ea6aa8edb3e58 /sed
parent86bbc911e93efe1f0957ee887182b3d64bb0eec4 (diff)
Imported Upstream version 4.2.2
Diffstat (limited to 'sed')
-rw-r--r--sed/Makefile.in629
-rw-r--r--sed/compile.c196
-rw-r--r--sed/execute.c356
-rw-r--r--sed/fmt.c41
-rw-r--r--sed/mbcs.c6
-rw-r--r--sed/regexp.c10
-rw-r--r--sed/sed.c92
-rw-r--r--sed/sed.h68
-rw-r--r--sed/utils.c107
-rw-r--r--sed/utils.h52
10 files changed, 900 insertions, 657 deletions
diff --git a/sed/Makefile.in b/sed/Makefile.in
index 62408cc..3a6a33b 100644
--- a/sed/Makefile.in
+++ b/sed/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10.1 from Makefile.am.
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -16,9 +16,26 @@
VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
@@ -36,56 +53,71 @@ host_triplet = @host@
bin_PROGRAMS = sed$(EXEEXT)
subdir = sed
DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in
+ $(srcdir)/Makefile.in $(top_srcdir)/build-aux/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
$(top_srcdir)/m4/acl.m4 $(top_srcdir)/m4/alloca.m4 \
- $(top_srcdir)/m4/btowc.m4 $(top_srcdir)/m4/codeset.m4 \
- $(top_srcdir)/m4/dirname.m4 $(top_srcdir)/m4/dos.m4 \
+ $(top_srcdir)/m4/btowc.m4 $(top_srcdir)/m4/canonicalize.m4 \
+ $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/configmake.m4 \
+ $(top_srcdir)/m4/dirname.m4 \
$(top_srcdir)/m4/double-slash-root.m4 \
- $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
- $(top_srcdir)/m4/exitfail.m4 $(top_srcdir)/m4/extensions.m4 \
- $(top_srcdir)/m4/getdelim.m4 $(top_srcdir)/m4/getline.m4 \
- $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/getpagesize.m4 \
- $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \
- $(top_srcdir)/m4/glibc21.m4 $(top_srcdir)/m4/gnulib-common.m4 \
+ $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/errno_h.m4 \
+ $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/extensions.m4 \
+ $(top_srcdir)/m4/extern-inline.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+ $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fstat.m4 \
+ $(top_srcdir)/m4/fwriting.m4 $(top_srcdir)/m4/getdelim.m4 \
+ $(top_srcdir)/m4/getopt.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \
+ $(top_srcdir)/m4/gnulib-common.m4 \
$(top_srcdir)/m4/gnulib-comp.m4 $(top_srcdir)/m4/iconv.m4 \
- $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inline.m4 \
- $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/include_next.m4 \
+ $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/langinfo_h.m4 \
+ $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lib-ld.m4 \
$(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
$(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
$(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-zh.m4 \
+ $(top_srcdir)/m4/locale_h.m4 $(top_srcdir)/m4/localeconv.m4 \
$(top_srcdir)/m4/longlong.m4 $(top_srcdir)/m4/lstat.m4 \
- $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/mbrlen.m4 \
- $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
- $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/memchr.m4 \
- $(top_srcdir)/m4/mkstemp.m4 $(top_srcdir)/m4/mmap-anon.m4 \
- $(top_srcdir)/m4/multiarch.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \
+ $(top_srcdir)/m4/mbrlen.m4 $(top_srcdir)/m4/mbrtowc.m4 \
+ $(top_srcdir)/m4/mbsinit.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+ $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
+ $(top_srcdir)/m4/mkostemp.m4 $(top_srcdir)/m4/mmap-anon.m4 \
+ $(top_srcdir)/m4/msvc-inval.m4 \
+ $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
+ $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/off_t.m4 \
$(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/po.m4 \
$(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/quote.m4 \
- $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/realloc.m4 \
- $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \
+ $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/readlink.m4 \
+ $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/regex.m4 \
+ $(top_srcdir)/m4/rename.m4 $(top_srcdir)/m4/rmdir.m4 \
$(top_srcdir)/m4/selinux-context-h.m4 \
$(top_srcdir)/m4/selinux-selinux-h.m4 \
- $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stdbool.m4 \
- $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdio_h.m4 \
- $(top_srcdir)/m4/stdlib_h.m4 $(top_srcdir)/m4/strerror.m4 \
- $(top_srcdir)/m4/string_h.m4 $(top_srcdir)/m4/strndup.m4 \
- $(top_srcdir)/m4/strnlen.m4 $(top_srcdir)/m4/strverscmp.m4 \
+ $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \
+ $(top_srcdir)/m4/stdarg.m4 $(top_srcdir)/m4/stdbool.m4 \
+ $(top_srcdir)/m4/stddef_h.m4 $(top_srcdir)/m4/stdint.m4 \
+ $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
+ $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \
+ $(top_srcdir)/m4/strverscmp.m4 \
+ $(top_srcdir)/m4/sys_socket_h.m4 \
$(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
- $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \
+ $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/tempname.m4 \
+ $(top_srcdir)/m4/threadlib.m4 $(top_srcdir)/m4/time_h.m4 \
$(top_srcdir)/m4/unistd_h.m4 $(top_srcdir)/m4/unlocked-io.m4 \
- $(top_srcdir)/m4/wchar.m4 $(top_srcdir)/m4/wcrtomb.m4 \
- $(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctype.m4 \
- $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/xalloc.m4 \
- $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/configure.ac
+ $(top_srcdir)/m4/version-etc.m4 \
+ $(top_srcdir)/m4/warn-on-use.m4 $(top_srcdir)/m4/wchar_h.m4 \
+ $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wcrtomb.m4 \
+ $(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctomb.m4 \
+ $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
+ $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_sed_OBJECTS = sed.$(OBJEXT) compile.$(OBJEXT) execute.$(OBJEXT) \
regexp.$(OBJEXT) fmt.$(OBJEXT) mbcs.$(OBJEXT) utils.$(OBJEXT)
@@ -93,21 +125,30 @@ sed_OBJECTS = $(am_sed_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
am__depfiles_maybe = depfiles
+am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(sed_SOURCES)
DIST_SOURCES = $(sed_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
HEADERS = $(noinst_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+pkglibexecdir = @pkglibexecdir@
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
ALLOCA_H = @ALLOCA_H@
AMTAR = @AMTAR@
APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -146,43 +187,76 @@ GMSGFMT_015 = @GMSGFMT_015@
GNULIB_ATOLL = @GNULIB_ATOLL@
GNULIB_BTOWC = @GNULIB_BTOWC@
GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
+GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
+GNULIB_CHDIR = @GNULIB_CHDIR@
GNULIB_CHOWN = @GNULIB_CHOWN@
GNULIB_CLOSE = @GNULIB_CLOSE@
GNULIB_DPRINTF = @GNULIB_DPRINTF@
+GNULIB_DUP = @GNULIB_DUP@
GNULIB_DUP2 = @GNULIB_DUP2@
+GNULIB_DUP3 = @GNULIB_DUP3@
+GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
GNULIB_ENVIRON = @GNULIB_ENVIRON@
GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
+GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
GNULIB_FCHDIR = @GNULIB_FCHDIR@
+GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
+GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
GNULIB_FCLOSE = @GNULIB_FCLOSE@
+GNULIB_FCNTL = @GNULIB_FCNTL@
+GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
+GNULIB_FDOPEN = @GNULIB_FDOPEN@
GNULIB_FFLUSH = @GNULIB_FFLUSH@
+GNULIB_FFSL = @GNULIB_FFSL@
+GNULIB_FFSLL = @GNULIB_FFSLL@
+GNULIB_FGETC = @GNULIB_FGETC@
+GNULIB_FGETS = @GNULIB_FGETS@
GNULIB_FOPEN = @GNULIB_FOPEN@
GNULIB_FPRINTF = @GNULIB_FPRINTF@
GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
GNULIB_FPURGE = @GNULIB_FPURGE@
GNULIB_FPUTC = @GNULIB_FPUTC@
GNULIB_FPUTS = @GNULIB_FPUTS@
+GNULIB_FREAD = @GNULIB_FREAD@
GNULIB_FREOPEN = @GNULIB_FREOPEN@
+GNULIB_FSCANF = @GNULIB_FSCANF@
GNULIB_FSEEK = @GNULIB_FSEEK@
GNULIB_FSEEKO = @GNULIB_FSEEKO@
+GNULIB_FSTAT = @GNULIB_FSTAT@
+GNULIB_FSTATAT = @GNULIB_FSTATAT@
GNULIB_FSYNC = @GNULIB_FSYNC@
GNULIB_FTELL = @GNULIB_FTELL@
GNULIB_FTELLO = @GNULIB_FTELLO@
GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
+GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
GNULIB_FWRITE = @GNULIB_FWRITE@
+GNULIB_GETC = @GNULIB_GETC@
+GNULIB_GETCHAR = @GNULIB_GETCHAR@
GNULIB_GETCWD = @GNULIB_GETCWD@
GNULIB_GETDELIM = @GNULIB_GETDELIM@
GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
+GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
GNULIB_GETLINE = @GNULIB_GETLINE@
GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
+GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_ISATTY = @GNULIB_ISATTY@
+GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
+GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
GNULIB_LCHMOD = @GNULIB_LCHMOD@
GNULIB_LCHOWN = @GNULIB_LCHOWN@
GNULIB_LINK = @GNULIB_LINK@
+GNULIB_LINKAT = @GNULIB_LINKAT@
+GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
GNULIB_LSEEK = @GNULIB_LSEEK@
GNULIB_LSTAT = @GNULIB_LSTAT@
GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
@@ -205,30 +279,67 @@ GNULIB_MBSSEP = @GNULIB_MBSSEP@
GNULIB_MBSSPN = @GNULIB_MBSSPN@
GNULIB_MBSSTR = @GNULIB_MBSSTR@
GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
+GNULIB_MBTOWC = @GNULIB_MBTOWC@
GNULIB_MEMCHR = @GNULIB_MEMCHR@
GNULIB_MEMMEM = @GNULIB_MEMMEM@
GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
+GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
+GNULIB_MKFIFO = @GNULIB_MKFIFO@
+GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
+GNULIB_MKNOD = @GNULIB_MKNOD@
+GNULIB_MKNODAT = @GNULIB_MKNODAT@
+GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
+GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
+GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
+GNULIB_MKTIME = @GNULIB_MKTIME@
+GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
+GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
+GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
+GNULIB_OPEN = @GNULIB_OPEN@
+GNULIB_OPENAT = @GNULIB_OPENAT@
+GNULIB_PCLOSE = @GNULIB_PCLOSE@
GNULIB_PERROR = @GNULIB_PERROR@
+GNULIB_PIPE = @GNULIB_PIPE@
+GNULIB_PIPE2 = @GNULIB_PIPE2@
+GNULIB_POPEN = @GNULIB_POPEN@
+GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
+GNULIB_PREAD = @GNULIB_PREAD@
GNULIB_PRINTF = @GNULIB_PRINTF@
GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
+GNULIB_PTSNAME = @GNULIB_PTSNAME@
+GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
GNULIB_PUTC = @GNULIB_PUTC@
GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
GNULIB_PUTENV = @GNULIB_PUTENV@
GNULIB_PUTS = @GNULIB_PUTS@
+GNULIB_PWRITE = @GNULIB_PWRITE@
+GNULIB_RANDOM = @GNULIB_RANDOM@
GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
+GNULIB_READ = @GNULIB_READ@
GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
+GNULIB_REALPATH = @GNULIB_REALPATH@
+GNULIB_REMOVE = @GNULIB_REMOVE@
+GNULIB_RENAME = @GNULIB_RENAME@
+GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
+GNULIB_RMDIR = @GNULIB_RMDIR@
GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANF = @GNULIB_SCANF@
GNULIB_SETENV = @GNULIB_SETENV@
+GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
+GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
GNULIB_SLEEP = @GNULIB_SLEEP@
GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
+GNULIB_STAT = @GNULIB_STAT@
+GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
GNULIB_STPCPY = @GNULIB_STPCPY@
GNULIB_STPNCPY = @GNULIB_STPNCPY@
@@ -236,9 +347,12 @@ GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
GNULIB_STRDUP = @GNULIB_STRDUP@
GNULIB_STRERROR = @GNULIB_STRERROR@
+GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
+GNULIB_STRNCAT = @GNULIB_STRNCAT@
GNULIB_STRNDUP = @GNULIB_STRNDUP@
GNULIB_STRNLEN = @GNULIB_STRNLEN@
GNULIB_STRPBRK = @GNULIB_STRPBRK@
+GNULIB_STRPTIME = @GNULIB_STRPTIME@
GNULIB_STRSEP = @GNULIB_STRSEP@
GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
GNULIB_STRSTR = @GNULIB_STRSTR@
@@ -247,80 +361,193 @@ GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
GNULIB_STRTOLL = @GNULIB_STRTOLL@
GNULIB_STRTOULL = @GNULIB_STRTOULL@
GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
+GNULIB_SYMLINK = @GNULIB_SYMLINK@
+GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
+GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
+GNULIB_TIMEGM = @GNULIB_TIMEGM@
+GNULIB_TIME_R = @GNULIB_TIME_R@
+GNULIB_TMPFILE = @GNULIB_TMPFILE@
+GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
+GNULIB_UNLINK = @GNULIB_UNLINK@
+GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
+GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
GNULIB_UNSETENV = @GNULIB_UNSETENV@
+GNULIB_USLEEP = @GNULIB_USLEEP@
+GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
+GNULIB_VFSCANF = @GNULIB_VFSCANF@
GNULIB_VPRINTF = @GNULIB_VPRINTF@
GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
+GNULIB_VSCANF = @GNULIB_VSCANF@
GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
+GNULIB_WCPCPY = @GNULIB_WCPCPY@
+GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
+GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
+GNULIB_WCSCAT = @GNULIB_WCSCAT@
+GNULIB_WCSCHR = @GNULIB_WCSCHR@
+GNULIB_WCSCMP = @GNULIB_WCSCMP@
+GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
+GNULIB_WCSCPY = @GNULIB_WCSCPY@
+GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
+GNULIB_WCSDUP = @GNULIB_WCSDUP@
+GNULIB_WCSLEN = @GNULIB_WCSLEN@
+GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
+GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
+GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
+GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
+GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
+GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
+GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
+GNULIB_WCSSPN = @GNULIB_WCSSPN@
+GNULIB_WCSSTR = @GNULIB_WCSSTR@
+GNULIB_WCSTOK = @GNULIB_WCSTOK@
+GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
+GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
GNULIB_WCTOB = @GNULIB_WCTOB@
+GNULIB_WCTOMB = @GNULIB_WCTOMB@
+GNULIB_WCTRANS = @GNULIB_WCTRANS@
+GNULIB_WCTYPE = @GNULIB_WCTYPE@
GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
+GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
+GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
+GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
+GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
+GNULIB_WMEMSET = @GNULIB_WMEMSET@
GNULIB_WRITE = @GNULIB_WRITE@
+GNULIB__EXIT = @GNULIB__EXIT@
GREP = @GREP@
HAVE_ATOLL = @HAVE_ATOLL@
HAVE_BTOWC = @HAVE_BTOWC@
-HAVE_CALLOC_POSIX = @HAVE_CALLOC_POSIX@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
-HAVE_DECL_STRERROR = @HAVE_DECL_STRERROR@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
HAVE_DPRINTF = @HAVE_DPRINTF@
HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
HAVE_FSYNC = @HAVE_FSYNC@
HAVE_FTELLO = @HAVE_FTELLO@
HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
-HAVE_GETDOMAINNAME = @HAVE_GETDOMAINNAME@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
-HAVE_GETUSERSHELL = @HAVE_GETUSERSHELL@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
HAVE_LSTAT = @HAVE_LSTAT@
-HAVE_MALLOC_POSIX = @HAVE_MALLOC_POSIX@
HAVE_MBRLEN = @HAVE_MBRLEN@
HAVE_MBRTOWC = @HAVE_MBRTOWC@
HAVE_MBSINIT = @HAVE_MBSINIT@
+HAVE_MBSLEN = @HAVE_MBSLEN@
HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
+HAVE_MEMCHR = @HAVE_MEMCHR@
HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_MKDIRAT = @HAVE_MKDIRAT@
HAVE_MKDTEMP = @HAVE_MKDTEMP@
+HAVE_MKFIFO = @HAVE_MKFIFO@
+HAVE_MKFIFOAT = @HAVE_MKFIFOAT@
+HAVE_MKNOD = @HAVE_MKNOD@
+HAVE_MKNODAT = @HAVE_MKNODAT@
+HAVE_MKOSTEMP = @HAVE_MKOSTEMP@
+HAVE_MKOSTEMPS = @HAVE_MKOSTEMPS@
+HAVE_MKSTEMP = @HAVE_MKSTEMP@
+HAVE_MKSTEMPS = @HAVE_MKSTEMPS@
+HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
+HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_RANDOM = @HAVE_RANDOM@
HAVE_RANDOM_H = @HAVE_RANDOM_H@
HAVE_RANDOM_R = @HAVE_RANDOM_R@
HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
HAVE_READLINK = @HAVE_READLINK@
-HAVE_REALLOC_POSIX = @HAVE_REALLOC_POSIX@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
HAVE_RPMATCH = @HAVE_RPMATCH@
HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
HAVE_SIGNED_WCHAR_T = @HAVE_SIGNED_WCHAR_T@
HAVE_SIGNED_WINT_T = @HAVE_SIGNED_WINT_T@
@@ -330,8 +557,8 @@ HAVE_STPCPY = @HAVE_STPCPY@
HAVE_STPNCPY = @HAVE_STPNCPY@
HAVE_STRCASESTR = @HAVE_STRCASESTR@
HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
-HAVE_STRNDUP = @HAVE_STRNDUP@
HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRPTIME = @HAVE_STRPTIME@
HAVE_STRSEP = @HAVE_STRSEP@
HAVE_STRTOD = @HAVE_STRTOD@
HAVE_STRTOLL = @HAVE_STRTOLL@
@@ -339,24 +566,64 @@ HAVE_STRTOULL = @HAVE_STRTOULL@
HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
+HAVE_SYMLINK = @HAVE_SYMLINK@
+HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_TIMEGM = @HAVE_TIMEGM@
HAVE_UNISTD_H = @HAVE_UNISTD_H@
-HAVE_UNSETENV = @HAVE_UNSETENV@
+HAVE_UNLINKAT = @HAVE_UNLINKAT@
+HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
+HAVE_USLEEP = @HAVE_USLEEP@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
HAVE_VASPRINTF = @HAVE_VASPRINTF@
HAVE_VDPRINTF = @HAVE_VDPRINTF@
HAVE_WCHAR_H = @HAVE_WCHAR_H@
+HAVE_WCHAR_T = @HAVE_WCHAR_T@
+HAVE_WCPCPY = @HAVE_WCPCPY@
+HAVE_WCPNCPY = @HAVE_WCPNCPY@
HAVE_WCRTOMB = @HAVE_WCRTOMB@
+HAVE_WCSCASECMP = @HAVE_WCSCASECMP@
+HAVE_WCSCAT = @HAVE_WCSCAT@
+HAVE_WCSCHR = @HAVE_WCSCHR@
+HAVE_WCSCMP = @HAVE_WCSCMP@
+HAVE_WCSCOLL = @HAVE_WCSCOLL@
+HAVE_WCSCPY = @HAVE_WCSCPY@
+HAVE_WCSCSPN = @HAVE_WCSCSPN@
+HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
INCLUDE_NEXT = @INCLUDE_NEXT@
INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
INSTALL = @INSTALL@
@@ -389,22 +656,40 @@ MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H = @NEXT_AS_FIRST_DIRECTIVE_SELINUX_SELINUX_H@
+NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
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_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_SELINUX_SELINUX_H = @NEXT_SELINUX_SELINUX_H@
+NEXT_STDARG_H = @NEXT_STDARG_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
NEXT_STDINT_H = @NEXT_STDINT_H@
NEXT_STDIO_H = @NEXT_STDIO_H@
NEXT_STDLIB_H = @NEXT_STDLIB_H@
NEXT_STRING_H = @NEXT_STRING_H@
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_TIME_H = @NEXT_TIME_H@
NEXT_UNISTD_H = @NEXT_UNISTD_H@
NEXT_WCHAR_H = @NEXT_WCHAR_H@
NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
@@ -414,18 +699,28 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
POSUB = @POSUB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
RANLIB = @RANLIB@
REPLACE_BTOWC = @REPLACE_BTOWC@
+REPLACE_CALLOC = @REPLACE_CALLOC@
+REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
REPLACE_CHOWN = @REPLACE_CHOWN@
REPLACE_CLOSE = @REPLACE_CLOSE@
REPLACE_DPRINTF = @REPLACE_DPRINTF@
-REPLACE_FCHDIR = @REPLACE_FCHDIR@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
REPLACE_FFLUSH = @REPLACE_FFLUSH@
REPLACE_FOPEN = @REPLACE_FOPEN@
REPLACE_FPRINTF = @REPLACE_FPRINTF@
@@ -433,39 +728,101 @@ REPLACE_FPURGE = @REPLACE_FPURGE@
REPLACE_FREOPEN = @REPLACE_FREOPEN@
REPLACE_FSEEK = @REPLACE_FSEEK@
REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
REPLACE_FTELL = @REPLACE_FTELL@
REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_ISATTY = @REPLACE_ISATTY@
+REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
REPLACE_LCHOWN = @REPLACE_LCHOWN@
+REPLACE_LINK = @REPLACE_LINK@
+REPLACE_LINKAT = @REPLACE_LINKAT@
+REPLACE_LOCALECONV = @REPLACE_LOCALECONV@
+REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@
REPLACE_LSEEK = @REPLACE_LSEEK@
REPLACE_LSTAT = @REPLACE_LSTAT@
+REPLACE_MALLOC = @REPLACE_MALLOC@
REPLACE_MBRLEN = @REPLACE_MBRLEN@
REPLACE_MBRTOWC = @REPLACE_MBRTOWC@
REPLACE_MBSINIT = @REPLACE_MBSINIT@
REPLACE_MBSNRTOWCS = @REPLACE_MBSNRTOWCS@
REPLACE_MBSRTOWCS = @REPLACE_MBSRTOWCS@
REPLACE_MBSTATE_T = @REPLACE_MBSTATE_T@
+REPLACE_MBTOWC = @REPLACE_MBTOWC@
REPLACE_MEMCHR = @REPLACE_MEMCHR@
REPLACE_MEMMEM = @REPLACE_MEMMEM@
REPLACE_MKDIR = @REPLACE_MKDIR@
+REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKNOD = @REPLACE_MKNOD@
REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
+REPLACE_MKTIME = @REPLACE_MKTIME@
+REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_PREAD = @REPLACE_PREAD@
REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PTSNAME = @REPLACE_PTSNAME@
+REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
REPLACE_PUTENV = @REPLACE_PUTENV@
+REPLACE_PWRITE = @REPLACE_PWRITE@
+REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
+REPLACE_READ = @REPLACE_READ@
+REPLACE_READLINK = @REPLACE_READLINK@
+REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALPATH = @REPLACE_REALPATH@
+REPLACE_REMOVE = @REPLACE_REMOVE@
+REPLACE_RENAME = @REPLACE_RENAME@
+REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RMDIR = @REPLACE_RMDIR@
+REPLACE_SETENV = @REPLACE_SETENV@
+REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SLEEP = @REPLACE_SLEEP@
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
REPLACE_SPRINTF = @REPLACE_SPRINTF@
+REPLACE_STAT = @REPLACE_STAT@
+REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
REPLACE_STDIO_WRITE_FUNCS = @REPLACE_STDIO_WRITE_FUNCS@
+REPLACE_STPNCPY = @REPLACE_STPNCPY@
REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
REPLACE_STRDUP = @REPLACE_STRDUP@
REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
REPLACE_STRSTR = @REPLACE_STRSTR@
REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
@@ -475,29 +832,33 @@ REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
REPLACE_WRITE = @REPLACE_WRITE@
SED_FEATURE_VERSION = @SED_FEATURE_VERSION@
SELINUX_CONTEXT_H = @SELINUX_CONTEXT_H@
-SELINUX_SELINUX_H = @SELINUX_SELINUX_H@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+STDARG_H = @STDARG_H@
STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
-SYS_STAT_H = @SYS_STAT_H@
-SYS_TIME_H = @SYS_TIME_H@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
USE_ACL = @USE_ACL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
-VOID_UNSETENV = @VOID_UNSETENV@
-WCHAR_H = @WCHAR_H@
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
-WCTYPE_H = @WCTYPE_H@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
WINT_T_SUFFIX = @WINT_T_SUFFIX@
XFAIL_TESTS = @XFAIL_TESTS@
XGETTEXT = @XGETTEXT@
@@ -529,6 +890,7 @@ gl_LIBOBJS = @gl_LIBOBJS@
gl_LTLIBOBJS = @gl_LTLIBOBJS@
gltests_LIBOBJS = @gltests_LIBOBJS@
gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
@@ -540,6 +902,7 @@ infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+lispdir = @lispdir@
localedir = $(datadir)/locale
localstatedir = @localstatedir@
mandir = @mandir@
@@ -572,14 +935,14 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu sed/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu sed/Makefile
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits sed/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnits sed/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -597,30 +960,64 @@ $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
- else :; fi; \
- done
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed 's/$(EXEEXT)$$//' | \
+ while read p p1; do if test -f $$p; \
+ then echo "$$p"; echo "$$p"; else :; fi; \
+ done | \
+ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+ sed 'N;N;N;s,\n, ,g' | \
+ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+ if ($$2 == $$4) files[d] = files[d] " " $$1; \
+ else { print "f", $$3 "/" $$4, $$1; } } \
+ END { for (d in files) print "f", d, files[d] }' | \
+ while read type dir files; do \
+ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+ test -z "$$files" || { \
+ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+ } \
+ ; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
- done
+ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ files=`for p in $$list; do echo "$$p"; done | \
+ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+ -e 's/$$/$(EXEEXT)/' `; \
+ test -n "$$list" || exit 0; \
+ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+ cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-sed$(EXEEXT): $(sed_OBJECTS) $(sed_DEPENDENCIES)
+
+installcheck-binPROGRAMS: $(bin_PROGRAMS)
+ bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \
+ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \
+ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \
+ esac; \
+ f=`echo "$$p" | \
+ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ for opt in --help --version; do \
+ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \
+ 2>c$${pid}_.err </dev/null \
+ && test -n "`cat c$${pid}_.out`" \
+ && test -z "`cat c$${pid}_.err`"; then :; \
+ else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
+ done; \
+ done; rm -f c$${pid}_.???; exit $$bad
+sed$(EXEEXT): $(sed_OBJECTS) $(sed_DEPENDENCIES) $(EXTRA_sed_DEPENDENCIES)
@rm -f sed$(EXEEXT)
$(LINK) $(sed_OBJECTS) $(sed_LDADD) $(LIBS)
@@ -640,14 +1037,14 @@ distclean-compile:
.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
@@ -657,14 +1054,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
+ set x; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
@@ -672,29 +1069,48 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
- tags=; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in files) print i; }; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
+ $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
@@ -715,13 +1131,17 @@ distdir: $(DISTFILES)
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@@ -742,16 +1162,22 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -772,6 +1198,8 @@ dvi-am:
html: html-am
+html-am:
+
info: info-am
info-am:
@@ -780,19 +1208,29 @@ install-data-am:
install-dvi: install-dvi-am
+install-dvi-am:
+
install-exec-am: install-binPROGRAMS
install-html: install-html-am
+install-html-am:
+
install-info: install-info-am
+install-info-am:
+
install-man:
install-pdf: install-pdf-am
+install-pdf-am:
+
install-ps: install-ps-am
-installcheck-am:
+install-ps-am:
+
+installcheck-am: installcheck-binPROGRAMS
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
@@ -816,20 +1254,21 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
- clean-generic ctags distclean distclean-compile \
+ clean-generic cscopelist ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-binPROGRAMS
+ installcheck installcheck-am installcheck-binPROGRAMS \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
+ ps ps-am tags uninstall uninstall-am uninstall-binPROGRAMS
$(PROGRAMS): $(LDADD)
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/sed/compile.c b/sed/compile.c
index c4a5250..513fac5 100644
--- a/sed/compile.c
+++ b/sed/compile.c
@@ -1,5 +1,5 @@
/* GNU SED, a batch stream editor.
- Copyright (C) 1989,90,91,92,93,94,95,98,99,2002,2003,2004,2005,2006,2008
+ Copyright (C) 1989,90,91,92,93,94,95,98,99,2002,2003,2004,2005,2006,2008,2010
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -21,27 +21,9 @@
#include "sed.h"
#include <stdio.h>
#include <ctype.h>
-
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-# ifdef HAVE_MEMORY_H
-# include <memory.h>
-# endif
-#else
-# include <string.h>
-#endif /* HAVE_STRINGS_H */
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#ifndef EXIT_FAILURE
-# define EXIT_FAILURE 1
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
#include <obstack.h>
@@ -155,7 +137,8 @@ static const char errors[] =
"delimiter character is not a single-byte character\0"
"expected newer version of sed\0"
"invalid usage of line address 0\0"
- "unknown command: `%c'";
+ "unknown command: `%c'\0"
+ "incomplete command";
#define BAD_BANG (errors)
#define BAD_COMMA (BAD_BANG + sizeof(N_("multiple `!'s")))
@@ -182,7 +165,8 @@ static const char errors[] =
#define ANCIENT_VERSION (BAD_DELIM + sizeof(N_("delimiter character is not a single-byte character")))
#define INVALID_LINE_0 (ANCIENT_VERSION + sizeof(N_("expected newer version of sed")))
#define UNKNOWN_CMD (INVALID_LINE_0 + sizeof(N_("invalid usage of line address 0")))
-#define END_ERRORS (UNKNOWN_CMD + sizeof(N_("unknown command: `%c'")))
+#define INCOMPLETE_CMD (UNKNOWN_CMD + sizeof(N_("unknown command: `%c'")))
+#define END_ERRORS (INCOMPLETE_CMD + sizeof(N_("incomplete command")))
static struct output *file_read = NULL;
static struct output *file_write = NULL;
@@ -206,12 +190,12 @@ bad_prog(why)
{
if (cur_input.name)
fprintf(stderr, _("%s: file %s line %lu: %s\n"),
- myname, cur_input.name, CAST(unsigned long)cur_input.line, why);
+ myname, cur_input.name, (unsigned long)cur_input.line, why);
else
fprintf(stderr, _("%s: -e expression #%lu, char %lu: %s\n"),
myname,
- CAST(unsigned long)cur_input.string_expr_count,
- CAST(unsigned long)(prog.cur-prog.base),
+ (unsigned long)cur_input.string_expr_count,
+ (unsigned long)(prog.cur-prog.base),
why);
exit(EXIT_FAILURE);
}
@@ -220,7 +204,7 @@ bad_prog(why)
/* Read the next character from the program. Return EOF if there isn't
anything to read. Keep cur_input.line up to date, so error messages
can be meaningful. */
-static int inchar P_((void));
+static int inchar (void);
static int
inchar()
{
@@ -242,7 +226,7 @@ inchar()
}
/* unget `ch' so the next call to inchar will return it. */
-static void savchar P_((int ch));
+static void savchar (int ch);
static void
savchar(ch)
int ch;
@@ -255,14 +239,14 @@ savchar(ch)
{
if (prog.cur <= prog.base || *--prog.cur != ch)
panic("Called savchar() with unexpected pushback (%x)",
- CAST(unsigned char)ch);
+ (unsigned char)ch);
}
else
ungetc(ch, prog.file);
}
/* Read the next non-blank character from the program. */
-static int in_nonblank P_((void));
+static int in_nonblank (void);
static int
in_nonblank()
{
@@ -274,7 +258,7 @@ in_nonblank()
}
/* Read an integer value from the program. */
-static countT in_integer P_((int ch));
+static countT in_integer (int ch);
static countT
in_integer(ch)
int ch;
@@ -290,7 +274,7 @@ in_integer(ch)
return num;
}
-static int add_then_next P_((struct buffer *b, int ch));
+static int add_then_next (struct buffer *b, int ch);
static int
add_then_next(b, ch)
struct buffer *b;
@@ -300,20 +284,19 @@ add_then_next(b, ch)
return inchar();
}
-static char * convert_number P_((char *, char *, const char *, int, int, int));
+static char * convert_number (char *, char *, const char *, int);
static char *
-convert_number(result, buf, bufend, base, maxdigits, default_char)
+convert_number(result, buf, bufend, base)
char *result;
char *buf;
const char *bufend;
int base;
- int maxdigits;
- int default_char;
{
int n = 0;
+ int max = 1;
char *p;
- for (p=buf; p < bufend && maxdigits-- > 0; ++p)
+ for (p=buf+1; p < bufend && max <= 255; ++p, max *= base)
{
int d = -1;
switch (*p)
@@ -339,8 +322,8 @@ convert_number(result, buf, bufend, base, maxdigits, default_char)
break;
n = n * base + d;
}
- if (p == buf)
- *result = default_char;
+ if (p == buf+1)
+ *result = *buf;
else
*result = n;
return p;
@@ -348,7 +331,7 @@ convert_number(result, buf, bufend, base, maxdigits, default_char)
/* Read in a filename for a `r', `w', or `s///w' command. */
-static struct buffer *read_filename P_((void));
+static struct buffer *read_filename (void);
static struct buffer *
read_filename()
{
@@ -373,7 +356,7 @@ read_filename()
return b;
}
-static struct output *get_openfile P_((struct output **file_ptrs, const char *mode, int fail));
+static struct output *get_openfile (struct output **file_ptrs, const char *mode, int fail);
static struct output *
get_openfile(file_ptrs, mode, fail)
struct output **file_ptrs;
@@ -421,7 +404,7 @@ get_openfile(file_ptrs, mode, fail)
}
-static struct sed_cmd *next_cmd_entry P_((struct vector **vectorp));
+static struct sed_cmd *next_cmd_entry (struct vector **vectorp);
static struct sed_cmd *
next_cmd_entry(vectorp)
struct vector **vectorp;
@@ -447,7 +430,7 @@ next_cmd_entry(vectorp)
return cmd;
}
-static int snarf_char_class P_((struct buffer *b, mbstate_t *cur_stat));
+static int snarf_char_class (struct buffer *b, mbstate_t *cur_stat);
static int
snarf_char_class(b, cur_stat)
struct buffer *b;
@@ -528,7 +511,7 @@ snarf_char_class(b, cur_stat)
}
}
-static struct buffer *match_slash P_((int slash, int regex));
+static struct buffer *match_slash (int slash, int regex);
static struct buffer *
match_slash(slash, regex)
int slash;
@@ -584,7 +567,7 @@ match_slash(slash, regex)
return NULL;
}
-static int mark_subst_opts P_((struct subst *cmd));
+static int mark_subst_opts (struct subst *cmd);
static int
mark_subst_opts(cmd)
struct subst *cmd;
@@ -650,7 +633,7 @@ mark_subst_opts(cmd)
break;
case 'w':
- cmd->outf = get_openfile(&file_write, "w", true);
+ cmd->outf = get_openfile(&file_write, write_mode, true);
return flags;
case '0': case '1': case '2': case '3': case '4':
@@ -684,7 +667,7 @@ mark_subst_opts(cmd)
/* read in a label for a `:', `b', or `t' command */
-static char *read_label P_((void));
+static char *read_label (void);
static char *
read_label()
{
@@ -711,7 +694,7 @@ read_label()
compilation is complete, or a reference created by a `{' to be
backpatched when the corresponding `}' is found. */
static struct sed_label *setup_label
- P_((struct sed_label *, countT, char *, const struct error_info *));
+ (struct sed_label *, countT, char *, const struct error_info *);
static struct sed_label *
setup_label(list, idx, name, err_info)
struct sed_label *list;
@@ -723,12 +706,12 @@ setup_label(list, idx, name, err_info)
ret->v_index = idx;
ret->name = name;
if (err_info)
- MEMCPY(&ret->err_info, err_info, sizeof (ret->err_info));
+ memcpy(&ret->err_info, err_info, sizeof (ret->err_info));
ret->next = list;
return ret;
}
-static struct sed_label *release_label P_((struct sed_label *list_head));
+static struct sed_label *release_label (struct sed_label *list_head);
static struct sed_label *
release_label(list_head)
struct sed_label *list_head;
@@ -739,22 +722,17 @@ release_label(list_head)
return NULL;
ret = list_head->next;
- FREE(list_head->name);
+ free(list_head->name);
#if 0
/* We use obstacks */
- FREE(list_head);
+ free(list_head);
#endif
return ret;
}
-static struct replacement *new_replacement P_((char *, size_t,
- enum replacement_types));
static struct replacement *
-new_replacement(text, length, type)
- char *text;
- size_t length;
- enum replacement_types type;
+new_replacement(char *text, size_t length, enum replacement_types type)
{
struct replacement *r = OB_MALLOC(&obs, 1, struct replacement);
@@ -767,7 +745,7 @@ new_replacement(text, length, type)
return r;
}
-static void setup_replacement P_((struct subst *, const char *, size_t));
+static void setup_replacement (struct subst *, const char *, size_t);
static void
setup_replacement(sub, text, length)
struct subst *sub;
@@ -794,7 +772,7 @@ setup_replacement(sub, text, length)
{
/* Preceding the backslash may be some literal text: */
tail = tail->next =
- new_replacement(base, CAST(size_t)(p - base), repl_type);
+ new_replacement(base, (size_t)(p - base), repl_type);
repl_type = save_type;
@@ -856,7 +834,7 @@ setup_replacement(sub, text, length)
{
/* Preceding the ampersand may be some literal text: */
tail = tail->next =
- new_replacement(base, CAST(size_t)(p - base), repl_type);
+ new_replacement(base, (size_t)(p - base), repl_type);
repl_type = save_type;
tail->subst_id = 0;
@@ -866,13 +844,13 @@ setup_replacement(sub, text, length)
/* There may be some trailing literal text: */
if (base < text_end)
tail = tail->next =
- new_replacement(base, CAST(size_t)(text_end - base), repl_type);
+ new_replacement(base, (size_t)(text_end - base), repl_type);
tail->next = NULL;
sub->replacement = root.next;
}
-static void read_text P_((struct text_buf *buf, int leadin_ch));
+static void read_text (struct text_buf *buf, int leadin_ch);
static void
read_text(buf, leadin_ch)
struct text_buf *buf;
@@ -932,7 +910,7 @@ read_text(buf, leadin_ch)
return non-zero and store the resulting address in `*addr'.
If the input doesn't look like an address read nothing
and return zero. */
-static bool compile_address P_((struct addr *addr, int ch));
+static bool compile_address (struct addr *addr, int ch);
static bool
compile_address(addr, ch)
struct addr *addr;
@@ -1030,7 +1008,7 @@ compile_address(addr, ch)
/* Read a program (or a subprogram within `{' `}' pairs) in and store
the compiled form in `*vector'. Return a pointer to the new vector. */
-static struct vector *compile_program P_((struct vector *));
+static struct vector *compile_program (struct vector *);
static struct vector *
compile_program(vector)
struct vector *vector;
@@ -1095,11 +1073,11 @@ compile_program(vector)
/* Do not accept extended commands in --posix mode. Also,
a few commands only accept one address in that mode. */
if (posixicity == POSIXLY_BASIC)
- switch (ch)
- {
- case 'e': case 'v': case 'z': case 'L':
- case 'Q': case 'T': case 'R': case 'W':
- bad_command(ch);
+ switch (ch)
+ {
+ case 'e': case 'F': case 'v': case 'z': case 'L':
+ case 'Q': case 'T': case 'R': case 'W':
+ bad_command(ch);
case 'a': case 'i': case 'l':
case '=': case 'r':
@@ -1227,12 +1205,13 @@ compile_program(vector)
break;
- case '=':
- case 'd':
- case 'D':
- case 'g':
- case 'G':
- case 'h':
+ case '=':
+ case 'd':
+ case 'D':
+ case 'F':
+ case 'g':
+ case 'G':
+ case 'h':
case 'H':
case 'n':
case 'N':
@@ -1259,7 +1238,7 @@ compile_program(vector)
case 'W':
case 'w':
- cur_cmd->x.outf = get_openfile(&file_write, "w", true);
+ cur_cmd->x.outf = get_openfile(&file_write, write_mode, true);
break;
case 's':
@@ -1369,7 +1348,7 @@ compile_program(vector)
{
unsigned char *translate =
OB_MALLOC(&obs, YMAP_LENGTH, unsigned char);
- unsigned char *ustring = CAST(unsigned char *)src_buf;
+ unsigned char *ustring = (unsigned char *)src_buf;
if (len != dest_len)
bad_prog(_(Y_CMD_LEN));
@@ -1403,6 +1382,8 @@ compile_program(vector)
/* this is buried down here so that "continue" statements will miss it */
++vector->v_length;
}
+ if (posixicity == POSIXLY_BASIC && pending_text)
+ bad_prog (_(INCOMPLETE_CMD));
return vector;
}
@@ -1417,6 +1398,8 @@ normalize_text(buf, len, buftype)
const char *bufend = buf + len;
char *p = buf;
char *q = buf;
+ char ch;
+ int base;
/* This variable prevents normalizing text within bracket
subexpressions when conforming to POSIX. If 0, we
@@ -1432,7 +1415,6 @@ normalize_text(buf, len, buftype)
while (p < bufend)
{
- int c;
mbclen = MBRLEN (p, bufend - p, &cur_stat);
if (mbclen != 1)
{
@@ -1448,7 +1430,7 @@ normalize_text(buf, len, buftype)
}
if (*p == '\\' && p+1 < bufend && bracket_state == 0)
- switch ( (c = *++p) )
+ switch (*++p)
{
#if defined __STDC__ && __STDC__-0
case 'a': *q++ = '\a'; p++; continue;
@@ -1464,14 +1446,12 @@ normalize_text(buf, len, buftype)
case 'v': *q++ = '\v'; p++; continue;
case 'd': /* decimal byte */
- p = convert_number(q, p+1, bufend, 10, 3, 'd');
- q++;
- continue;
+ base = 10;
+ goto convert;
case 'x': /* hexadecimal byte */
- p = convert_number(q, p+1, bufend, 16, 2, 'x');
- q++;
- continue;
+ base = 16;
+ goto convert;
#ifdef REG_PERL
case '0': case '1': case '2': case '3':
@@ -1480,8 +1460,8 @@ normalize_text(buf, len, buftype)
&& p+1 < bufend
&& p[1] >= '0' && p[1] <= '9')
{
- p = convert_number(q, p, bufend, 8, 3, *p);
- q++;
+ base = 8;
+ goto convert;
}
else
{
@@ -1495,8 +1475,8 @@ normalize_text(buf, len, buftype)
case 'o': /* octal byte */
if (!(extended_regexp_flags & REG_PERL))
{
- p = convert_number(q, p+1, bufend, 8, 3, 'o');
- q++;
+ base = 8;
+ goto convert;
}
else
{
@@ -1508,15 +1488,21 @@ normalize_text(buf, len, buftype)
continue;
#else
case 'o': /* octal byte */
- p = convert_number(q, p+1, bufend, 8, 3, 'o');
- q++;
- continue;
+ base = 8;
#endif
+convert:
+ p = convert_number(&ch, p, bufend, base);
+
+ /* for an ampersand in a replacement, pass the \ up one level */
+ if (buftype == TEXT_REPLACEMENT && ch == '&')
+ *q++ = '\\';
+ *q++ = ch;
+ continue;
case 'c':
if (++p < bufend)
{
- *q++ = toupper(*p) ^ 0x40;
+ *q++ = toupper((unsigned char) *p) ^ 0x40;
p++;
continue;
}
@@ -1577,7 +1563,7 @@ compile_string(cur_program, str, len)
struct vector *ret;
prog.file = NULL;
- prog.base = CAST(unsigned char *)str;
+ prog.base = (unsigned char *)str;
prog.cur = prog.base;
prog.end = prog.cur + len;
@@ -1606,7 +1592,13 @@ compile_file(cur_program, cmdfile)
prog.file = stdin;
if (cmdfile[0] != '-' || cmdfile[1] != '\0')
- prog.file = ck_fopen(cmdfile, "rt", true);
+ {
+#ifdef HAVE_FOPEN_RT
+ prog.file = ck_fopen(cmdfile, "rt", true);
+#else
+ prog.file = ck_fopen(cmdfile, "r", true);
+#endif
+ }
cur_input.line = 1;
cur_input.name = cmdfile;
@@ -1635,7 +1627,7 @@ check_final_program(program)
if (blocks)
{
/* update info for error reporting: */
- MEMCPY(&cur_input, &blocks->err_info, sizeof (cur_input));
+ memcpy(&cur_input, &blocks->err_info, sizeof (cur_input));
bad_prog(_(EXCESS_OPEN_BRACE));
}
@@ -1679,14 +1671,14 @@ check_final_program(program)
for (p=file_read; p; p=p->link)
if (p->name)
{
- FREE(p->name);
+ free(p->name);
p->name = NULL;
}
for (p=file_write; p; p=p->link)
if (p->name)
{
- FREE(p->name);
+ free(p->name);
p->name = NULL;
}
}
@@ -1719,7 +1711,7 @@ finish_program(program)
q = p->link;
#if 0
/* We use obstacks. */
- FREE(p);
+ free(p);
#endif
}
@@ -1730,7 +1722,7 @@ finish_program(program)
q = p->link;
#if 0
/* We use obstacks. */
- FREE(p);
+ free(p);
#endif
}
file_read = file_write = NULL;
diff --git a/sed/execute.c b/sed/execute.c
index 6fbfff6..cb84192 100644
--- a/sed/execute.c
+++ b/sed/execute.c
@@ -25,24 +25,17 @@
#include <stddef.h>
#include <stdio.h>
#include <ctype.h>
-
+#include <unistd.h>
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include "stat-macros.h"
-#ifndef BOOTSTRAP
#include <selinux/selinux.h>
#include <selinux/context.h>
-#endif
-
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-#ifndef BOOTSTRAP
#include "acl.h"
-#endif
#ifdef __GNUC__
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__-0 >= 7)
@@ -54,34 +47,6 @@ extern int errno;
# define UNUSED
#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#else
-# include <string.h>
-#endif /*HAVE_STRINGS_H*/
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif
-
-#ifndef HAVE_STRCHR
-# define strchr index
-# define strrchr rindex
-#endif
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-#ifndef EXIT_SUCCESS
-# define EXIT_SUCCESS 0
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#include <sys/stat.h>
-#include "stat-macros.h"
-
/* Sed operates a line at a time. */
struct line {
@@ -90,16 +55,10 @@ struct line {
size_t length; /* Length of text (or active, if used). */
size_t alloc; /* Allocated space for active. */
bool chomped; /* Was a trailing newline dropped? */
-#ifdef HAVE_MBRTOWC
mbstate_t mbstate;
-#endif
};
-#ifdef HAVE_MBRTOWC
#define SIZEOF_LINE offsetof (struct line, mbstate)
-#else
-#define SIZEOF_LINE (sizeof (struct line))
-#endif
/* A queue of text to write out at the end of a cycle
(filled by the "a", "r" and "R" commands.) */
@@ -132,7 +91,7 @@ struct input {
/* Function to read one line. If FP is NULL, read_fn better not
be one which uses fp; in particular, read_always_fail() is
recommended. */
- bool (*read_fn) P_((struct input *)); /* read one line */
+ bool (*read_fn) (struct input *); /* read one line */
char *out_file_name;
@@ -171,37 +130,9 @@ static struct append_queue *append_head = NULL;
static struct append_queue *append_tail = NULL;
-#ifdef BOOTSTRAP
-/* We can't be sure that the system we're boostrapping on has
- memchr(), and ../lib/memchr.c requires configuration knowledge
- about how many bits are in a `long'. This implementation
- is far from ideal, but it should get us up-and-limping well
- enough to run the configure script, which is all that matters.
-*/
-# ifdef memchr
-# undef memchr
-# endif
-# define memchr bootstrap_memchr
-
-static VOID *bootstrap_memchr P_((const VOID *s, int c, size_t n));
-static VOID *
-bootstrap_memchr(s, c, n)
- const VOID *s;
- int c;
- size_t n;
-{
- char *p;
-
- for (p=(char *)s; n-- > 0; ++p)
- if (*p == c)
- return p;
- return CAST(VOID *)0;
-}
-#endif /*BOOTSTRAP*/
-
/* increase a struct line's length, making some attempt at
keeping realloc() calls under control by padding for future growth. */
-static void resize_line P_((struct line *, size_t));
+static void resize_line (struct line *, size_t);
static void
resize_line(lb, len)
struct line *lb;
@@ -214,7 +145,7 @@ resize_line(lb, len)
* remove it. */
if (inactive > lb->alloc * 2)
{
- MEMMOVE(lb->text, lb->active, lb->length);
+ memmove(lb->text, lb->active, lb->length);
lb->alloc += lb->active - lb->text;
lb->active = lb->text;
inactive = 0;
@@ -234,7 +165,7 @@ resize_line(lb, len)
}
/* Append `length' bytes from `string' to the line `to'. */
-static void str_append P_((struct line *, const char *, size_t));
+static void str_append (struct line *, const char *, size_t);
static void
str_append(to, string, length)
struct line *to;
@@ -245,17 +176,16 @@ str_append(to, string, length)
if (to->alloc < new_length)
resize_line(to, new_length);
- MEMCPY(to->active + to->length, string, length);
+ memcpy(to->active + to->length, string, length);
to->length = new_length;
-#ifdef HAVE_MBRTOWC
if (mb_cur_max > 1 && !is_utf8)
while (length)
{
size_t n = MBRLEN (string, length, &to->mbstate);
- /* An invalid sequence is treated like a singlebyte character. */
- if (n == (size_t) -1)
+ /* An invalid or imcomplete sequence is treated like a singlebyte character. */
+ if (n == (size_t) -1 || n == (size_t) -2)
{
memset (&to->mbstate, 0, sizeof (to->mbstate));
n = 1;
@@ -269,19 +199,12 @@ str_append(to, string, length)
else
break;
}
-#endif
}
-static void str_append_modified P_((struct line *, const char *, size_t,
- enum replacement_types));
static void
-str_append_modified(to, string, length, type)
- struct line *to;
- const char *string;
- size_t length;
- enum replacement_types type;
+str_append_modified(struct line *to, const char *string, size_t length,
+ enum replacement_types type)
{
-#ifdef HAVE_MBRTOWC
mbstate_t from_stat;
if (type == REPL_ASIS)
@@ -293,7 +216,7 @@ str_append_modified(to, string, length, type)
if (to->alloc - to->length < length * mb_cur_max)
resize_line(to, to->length + length * mb_cur_max);
- MEMCPY (&from_stat, &to->mbstate, sizeof(mbstate_t));
+ memcpy (&from_stat, &to->mbstate, sizeof(mbstate_t));
while (length)
{
wchar_t wc;
@@ -341,50 +264,17 @@ str_append_modified(to, string, length, type)
/* Copy the new wide character to the end of the string. */
n = WCRTOMB (to->active + to->length, wc, &to->mbstate);
to->length += n;
- if (n == -1)
+ if (n == -1 || n == -2)
{
fprintf (stderr, "Case conversion produced an invalid character!");
abort ();
}
}
-#else
- size_t old_length = to->length;
- char *start, *end;
-
- str_append(to, string, length);
- start = to->active + old_length;
- end = start + length;
-
- /* Now do the required modifications. First \[lu]... */
- if (type & REPL_UPPERCASE_FIRST)
- {
- *start = toupper(*start);
- start++;
- type &= ~REPL_UPPERCASE_FIRST;
- }
- else if (type & REPL_LOWERCASE_FIRST)
- {
- *start = tolower(*start);
- start++;
- type &= ~REPL_LOWERCASE_FIRST;
- }
-
- if (type == REPL_ASIS)
- return;
-
- /* ...and then \[LU] */
- if (type == REPL_UPPERCASE)
- for (; start != end; start++)
- *start = toupper(*start);
- else
- for (; start != end; start++)
- *start = tolower(*start);
-#endif
}
/* Initialize a "struct line" buffer. Copy multibyte state from `state'
if not null. */
-static void line_init P_((struct line *, struct line *, size_t initial_size));
+static void line_init (struct line *, struct line *, size_t initial_size);
static void
line_init(buf, state, initial_size)
struct line *buf;
@@ -397,17 +287,15 @@ line_init(buf, state, initial_size)
buf->length = 0;
buf->chomped = true;
-#ifdef HAVE_MBRTOWC
if (state)
memcpy (&buf->mbstate, &state->mbstate, sizeof (buf->mbstate));
else
memset (&buf->mbstate, 0, sizeof (buf->mbstate));
-#endif
}
/* Reset a "struct line" buffer to length zero. Copy multibyte state from
`state' if not null. */
-static void line_reset P_((struct line *, struct line *));
+static void line_reset (struct line *, struct line *);
static void
line_reset(buf, state)
struct line *buf, *state;
@@ -417,19 +305,17 @@ line_reset(buf, state)
else
{
buf->length = 0;
-#ifdef HAVE_MBRTOWC
if (state)
memcpy (&buf->mbstate, &state->mbstate, sizeof (buf->mbstate));
else
memset (&buf->mbstate, 0, sizeof (buf->mbstate));
-#endif
}
}
/* Copy the contents of the line `from' into the line `to'.
This destroys the old contents of `to'.
Copy the multibyte state if `state' is true. */
-static void line_copy P_((struct line *from, struct line *to, int state));
+static void line_copy (struct line *from, struct line *to, int state);
static void
line_copy(from, to, state)
struct line *from;
@@ -446,45 +332,41 @@ line_copy(from, to, state)
to->alloc = from->length;
if (to->alloc < INITIAL_BUFFER_SIZE)
to->alloc = INITIAL_BUFFER_SIZE;
- /* Use FREE()+MALLOC() instead of REALLOC() to
+ /* Use free()+MALLOC() instead of REALLOC() to
avoid unnecessary copying of old text. */
- FREE(to->text);
+ free(to->text);
to->text = MALLOC(to->alloc, char);
}
to->active = to->text;
to->length = from->length;
to->chomped = from->chomped;
- MEMCPY(to->active, from->active, from->length);
+ memcpy(to->active, from->active, from->length);
-#ifdef HAVE_MBRTOWC
if (state)
- MEMCPY(&to->mbstate, &from->mbstate, sizeof (from->mbstate));
-#endif
+ memcpy(&to->mbstate, &from->mbstate, sizeof (from->mbstate));
}
/* Append the contents of the line `from' to the line `to'.
Copy the multibyte state if `state' is true. */
-static void line_append P_((struct line *from, struct line *to, int state));
+static void line_append (struct line *from, struct line *to, int state);
static void
line_append(from, to, state)
struct line *from;
struct line *to;
int state;
{
- str_append(to, "\n", 1);
+ str_append(to, &buffer_delimiter, 1);
str_append(to, from->active, from->length);
to->chomped = from->chomped;
-#ifdef HAVE_MBRTOWC
if (state)
- MEMCPY (&to->mbstate, &from->mbstate, sizeof (from->mbstate));
-#endif
+ memcpy (&to->mbstate, &from->mbstate, sizeof (from->mbstate));
}
/* Exchange two "struct line" buffers.
Copy the multibyte state if `state' is true. */
-static void line_exchange P_((struct line *a, struct line *b, int state));
+static void line_exchange (struct line *a, struct line *b, int state);
static void
line_exchange(a, b, state)
struct line *a;
@@ -495,21 +377,21 @@ line_exchange(a, b, state)
if (state)
{
- MEMCPY(&t, a, sizeof (struct line));
- MEMCPY( a, b, sizeof (struct line));
- MEMCPY( b, &t, sizeof (struct line));
+ memcpy(&t, a, sizeof (struct line));
+ memcpy( a, b, sizeof (struct line));
+ memcpy( b, &t, sizeof (struct line));
}
else
{
- MEMCPY(&t, a, SIZEOF_LINE);
- MEMCPY( a, b, SIZEOF_LINE);
- MEMCPY( b, &t, SIZEOF_LINE);
+ memcpy(&t, a, SIZEOF_LINE);
+ memcpy( a, b, SIZEOF_LINE);
+ memcpy( b, &t, SIZEOF_LINE);
}
}
/* dummy function to simplify read_pattern_space() */
-static bool read_always_fail P_((struct input *));
+static bool read_always_fail (struct input *);
static bool
read_always_fail(input)
struct input *input UNUSED;
@@ -517,7 +399,7 @@ read_always_fail(input)
return false;
}
-static bool read_file_line P_((struct input *));
+static bool read_file_line (struct input *);
static bool
read_file_line(input)
struct input *input;
@@ -525,12 +407,12 @@ read_file_line(input)
static char *b;
static size_t blen;
- long result = ck_getline (&b, &blen, input->fp);
+ long result = ck_getdelim (&b, &blen, buffer_delimiter, input->fp);
if (result <= 0)
return false;
/* Remove the trailing new-line that is left by getline. */
- if (b[result - 1] == '\n')
+ if (b[result - 1] == buffer_delimiter)
--result;
else
line.chomped = false;
@@ -540,28 +422,28 @@ read_file_line(input)
}
-static inline void output_missing_newline P_((struct output *));
+static inline void output_missing_newline (struct output *);
static inline void
output_missing_newline(outf)
struct output *outf;
{
if (outf->missing_newline)
{
- ck_fwrite("\n", 1, 1, outf->fp);
+ ck_fwrite(&buffer_delimiter, 1, 1, outf->fp);
outf->missing_newline = false;
}
}
-static inline void flush_output P_((FILE *));
+static inline void flush_output (FILE *);
static inline void
flush_output(fp)
FILE *fp;
{
- if (fp != stdout || unbuffered_output)
+ if (fp != stdout || unbuffered)
ck_fflush(fp);
}
-static void output_line P_((const char *, size_t, int, struct output *));
+static void output_line (const char *, size_t, int, struct output *);
static void
output_line(text, length, nl, outf)
const char *text;
@@ -576,14 +458,14 @@ output_line(text, length, nl, outf)
if (length)
ck_fwrite(text, 1, length, outf->fp);
if (nl)
- ck_fwrite("\n", 1, 1, outf->fp);
+ ck_fwrite(&buffer_delimiter, 1, 1, outf->fp);
else
outf->missing_newline = true;
flush_output(outf->fp);
}
-static struct append_queue *next_append_slot P_((void));
+static struct append_queue *next_append_slot (void);
static struct append_queue *
next_append_slot()
{
@@ -602,7 +484,7 @@ next_append_slot()
return append_tail = n;
}
-static void release_append_queue P_((void));
+static void release_append_queue (void);
static void
release_append_queue()
{
@@ -611,15 +493,15 @@ release_append_queue()
for (p=append_head; p; p=q)
{
if (p->free)
- FREE(p->text);
+ free(p->text);
q = p->next;
- FREE(p);
+ free(p);
}
append_head = append_tail = NULL;
}
-static void dump_append_queue P_((void));
+static void dump_append_queue (void);
static void
dump_append_queue()
{
@@ -657,7 +539,7 @@ dump_append_queue()
/* Compute the name of the backup file for in-place editing */
-static char *get_backup_file_name P_((const char *));
+static char *get_backup_file_name (const char *);
static char *
get_backup_file_name(name)
const char *name;
@@ -678,7 +560,7 @@ get_backup_file_name(name)
(asterisk = strchr(old_asterisk, '*'));
old_asterisk = asterisk + 1)
{
- MEMCPY (p, old_asterisk, asterisk - old_asterisk);
+ memcpy (p, old_asterisk, asterisk - old_asterisk);
p += asterisk - old_asterisk;
strcpy (p, name);
p += name_length;
@@ -690,7 +572,7 @@ get_backup_file_name(name)
}
/* Initialize a struct input for the named file. */
-static void open_next_file P_((const char *name, struct input *));
+static void open_next_file (const char *name, struct input *);
static void
open_next_file(name, input)
const char *name;
@@ -701,7 +583,11 @@ open_next_file(name, input)
if (name[0] == '-' && name[1] == '\0' && !in_place_extension)
{
clearerr(stdin); /* clear any stale EOF indication */
+#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__)
input->fp = ck_fdopen (fileno (stdin), "stdin", read_mode, false);
+#else
+ input->fp = stdin;
+#endif
}
else if ( ! (input->fp = ck_fopen(name, read_mode, false)) )
{
@@ -714,20 +600,18 @@ open_next_file(name, input)
input->read_fn = read_file_line;
+ if (follow_symlinks)
+ input->in_file_name = follow_symlink (name);
+ else
+ input->in_file_name = name;
+
if (in_place_extension)
{
int input_fd;
char *tmpdir, *p;
-#ifndef BOOTSTRAP
security_context_t old_fscreatecon;
int reset_fscreatecon = 0;
memset (&old_fscreatecon, 0, sizeof (old_fscreatecon));
-#endif
-
- if (follow_symlinks)
- input->in_file_name = follow_symlink (name);
- else
- input->in_file_name = name;
/* get the base name */
tmpdir = ck_strdup(input->in_file_name);
@@ -744,8 +628,7 @@ open_next_file(name, input)
if (!S_ISREG (input->st.st_mode))
panic(_("couldn't edit %s: not a regular file"), input->in_file_name);
-#ifndef BOOTSTRAP
- if (is_selinux_enabled ())
+ if (is_selinux_enabled () > 0)
{
security_context_t con;
if (getfilecon (input->in_file_name, &con) != -1)
@@ -765,30 +648,32 @@ open_next_file(name, input)
myname, input->in_file_name, strerror (errno));
}
}
-#endif
- output_file.fp = ck_mkstemp (&input->out_file_name, tmpdir, "sed");
+ output_file.fp = ck_mkstemp (&input->out_file_name, tmpdir, "sed",
+ write_mode);
output_file.missing_newline = false;
free (tmpdir);
-#ifndef BOOTSTRAP
if (reset_fscreatecon)
{
setfscreatecon (old_fscreatecon);
freecon (old_fscreatecon);
}
-#endif
if (!output_file.fp)
panic(_("couldn't open temporary file %s: %s"), input->out_file_name, strerror(errno));
}
else
- output_file.fp = stdout;
+ {
+ if (input->fp && unbuffered)
+ setvbuf (input->fp, NULL, _IONBF, 0);
+ output_file.fp = stdout;
+ }
}
/* Clean up an input stream that we are done with. */
-static void closedown P_((struct input *));
+static void closedown (struct input *);
static void
closedown(input)
struct input *input;
@@ -805,13 +690,13 @@ closedown(input)
target_name = input->in_file_name;
input_fd = fileno (input->fp);
output_fd = fileno (output_file.fp);
- copy_acl (input->in_file_name, input_fd,
- input->out_file_name, output_fd,
- input->st.st_mode);
#ifdef HAVE_FCHOWN
if (fchown (output_fd, input->st.st_uid, input->st.st_gid) == -1)
fchown (output_fd, -1, input->st.st_gid);
#endif
+ copy_acl (input->in_file_name, input_fd,
+ input->out_file_name, output_fd,
+ input->st.st_mode);
ck_fclose (input->fp);
ck_fclose (output_file.fp);
@@ -832,7 +717,7 @@ closedown(input)
}
/* Reset range commands so that they are marked as non-matching */
-static void reset_addresses P_((struct vector *));
+static void reset_addresses (struct vector *);
static void
reset_addresses(vec)
struct vector *vec;
@@ -851,7 +736,7 @@ reset_addresses(vec)
/* Read in the next line of input, and store it in the pattern space.
Return zero if there is nothing left to input. */
-static bool read_pattern_space P_((struct input *, struct vector *, int));
+static bool read_pattern_space (struct input *, struct vector *, int);
static bool
read_pattern_space(input, the_program, append)
struct input *input;
@@ -896,7 +781,7 @@ read_pattern_space(input, the_program, append)
}
-static bool last_file_with_data_p P_((struct input *));
+static bool last_file_with_data_p (struct input *);
static bool
last_file_with_data_p(input)
struct input *input;
@@ -921,7 +806,7 @@ last_file_with_data_p(input)
}
/* Determine if we match the `$' address. */
-static bool test_eof P_((struct input *));
+static bool test_eof (struct input *);
static bool
test_eof(input)
struct input *input;
@@ -942,7 +827,7 @@ test_eof(input)
/* Return non-zero if the current line matches the address
pointed to by `addr'. */
-static bool match_an_address_p P_((struct addr *, struct input *));
+static bool match_an_address_p (struct addr *, struct input *);
static bool
match_an_address_p(addr, input)
struct addr *addr;
@@ -980,7 +865,7 @@ match_an_address_p(addr, input)
}
/* return non-zero if current address is valid for cmd */
-static bool match_address_p P_((struct sed_cmd *, struct input *));
+static bool match_address_p (struct sed_cmd *, struct input *);
static bool
match_address_p(cmd, input)
struct sed_cmd *cmd;
@@ -1059,12 +944,12 @@ match_address_p(cmd, input)
}
-static void do_list P_((int line_len));
+static void do_list (int line_len);
static void
do_list(line_len)
int line_len;
{
- unsigned char *p = CAST(unsigned char *)line.active;
+ unsigned char *p = (unsigned char *)line.active;
countT len = line.length;
countT width = 0;
char obuf[180]; /* just in case we encounter a 512-bit char (;-) */
@@ -1120,16 +1005,11 @@ do_list(line_len)
}
-static enum replacement_types append_replacement P_((struct line *, struct replacement *,
- struct re_registers *,
- enum replacement_types));
-static enum replacement_types
-append_replacement (buf, p, regs, repl_mod)
- struct line *buf;
- struct replacement *p;
- struct re_registers *regs;
- enum replacement_types repl_mod;
+static void append_replacement (struct line *buf, struct replacement *p,
+ struct re_registers *regs)
{
+ enum replacement_types repl_mod = 0;
+
for (; p; p=p->next)
{
int i = p->subst_id;
@@ -1160,15 +1040,13 @@ append_replacement (buf, p, regs, repl_mod)
else if (regs->end[i] != regs->start[i])
str_append_modified(buf, line.active + regs->start[i],
- CAST(size_t)(regs->end[i] - regs->start[i]),
+ (size_t)(regs->end[i] - regs->start[i]),
curr_type);
}
}
-
- return repl_mod;
}
-static void do_subst P_((struct subst *));
+static void do_subst (struct subst *);
static void
do_subst(sub)
struct subst *sub;
@@ -1212,8 +1090,6 @@ do_subst(sub)
do
{
- enum replacement_types repl_mod = 0;
-
size_t offset = regs.start[0];
size_t matched = regs.end[0] - regs.start[0];
@@ -1237,7 +1113,7 @@ do_subst(sub)
replaced = true;
/* Now expand the replacement string into the output string. */
- repl_mod = append_replacement (&s_accum, sub->replacement, &regs, repl_mod);
+ append_replacement (&s_accum, sub->replacement, &regs);
again = sub->global;
}
else
@@ -1310,7 +1186,7 @@ do_subst(sub)
for 'g' as to while the third argument is incorrect anyway. */
line_exchange(&line, &s_accum, true);
if (line.length &&
- line.active[line.length - 1] == '\n')
+ line.active[line.length - 1] == buffer_delimiter)
line.length--;
}
else
@@ -1331,7 +1207,7 @@ do_subst(sub)
static countT branches;
-static countT count_branches P_((struct vector *));
+static countT count_branches (struct vector *);
static countT
count_branches(program)
struct vector *program;
@@ -1354,7 +1230,7 @@ count_branches(program)
return cnt;
}
-static struct sed_cmd *shrink_program P_((struct vector *, struct sed_cmd *));
+static struct sed_cmd *shrink_program (struct vector *, struct sed_cmd *);
static struct sed_cmd *
shrink_program(vec, cur_cmd)
struct vector *vec;
@@ -1367,21 +1243,21 @@ shrink_program(vec, cur_cmd)
for (p=v; p < cur_cmd; ++p)
if (p->cmd != '#')
- MEMCPY(v++, p, sizeof *v);
+ memcpy(v++, p, sizeof *v);
cmd_cnt = v - vec->v;
for (; p < last_cmd; ++p)
if (p->cmd != '#')
- MEMCPY(v++, p, sizeof *v);
+ memcpy(v++, p, sizeof *v);
vec->v_length = v - vec->v;
- return (0 < vec->v_length) ? (vec->v + cmd_cnt) : CAST(struct sed_cmd *)0;
+ return (0 < vec->v_length) ? (vec->v + cmd_cnt) : (struct sed_cmd *)0;
}
#endif /*EXPERIMENTAL_DASH_N_OPTIMIZATION*/
/* Execute the program `vec' on the current input line.
Return exit status if caller should quit, -1 otherwise. */
-static int execute_program P_((struct vector *, struct input *));
+static int execute_program (struct vector *, struct input *);
static int
execute_program(vec, input)
struct vector *vec;
@@ -1430,7 +1306,7 @@ execute_program(vec, input)
case 'D':
{
- char *p = memchr(line.active, '\n', line.length);
+ char *p = memchr(line.active, buffer_delimiter, line.length);
if (!p)
return -1;
@@ -1480,7 +1356,7 @@ execute_program(vec, input)
{
/* Store into pattern space for plain `e' commands */
if (s_accum.length &&
- s_accum.active[s_accum.length - 1] == '\n')
+ s_accum.active[s_accum.length - 1] == buffer_delimiter)
s_accum.length--;
/* Exchange line and s_accum. This can be much
@@ -1561,7 +1437,7 @@ execute_program(vec, input)
break;
case 'N':
- str_append(&line, "\n", 1);
+ str_append(&line, &buffer_delimiter, 1);
if (test_eof(input) || !read_pattern_space(input, vec, true))
{
@@ -1579,7 +1455,7 @@ execute_program(vec, input)
case 'P':
{
- char *p = memchr(line.active, '\n', line.length);
+ char *p = memchr(line.active, buffer_delimiter, line.length);
output_line(line.active, p ? p - line.active : line.length,
p ? true : line.chomped, &output_file);
}
@@ -1609,7 +1485,8 @@ execute_program(vec, input)
char *text = NULL;
int result;
- result = ck_getline (&text, &buflen, cur_cmd->x.fp);
+ result = ck_getdelim (&text, &buflen, buffer_delimiter,
+ cur_cmd->x.fp);
if (result != EOF)
{
aq = next_append_slot();
@@ -1652,7 +1529,7 @@ execute_program(vec, input)
case 'W':
if (cur_cmd->x.fp)
{
- char *p = memchr(line.active, '\n', line.length);
+ char *p = memchr(line.active, buffer_delimiter, line.length);
output_line(line.active, p ? p - line.active : line.length,
p ? true : line.chomped, cur_cmd->x.outf);
}
@@ -1665,7 +1542,6 @@ execute_program(vec, input)
case 'y':
{
-#ifdef HAVE_MBRTOWC
if (mb_cur_max > 1)
{
int idx, prev_idx; /* index in the input line. */
@@ -1733,10 +1609,9 @@ execute_program(vec, input)
}
}
else
-#endif /* HAVE_MBRTOWC */
{
unsigned char *p, *e;
- p = CAST(unsigned char *)line.active;
+ p = (unsigned char *)line.active;
for (e=p+line.length; p<e; ++p)
*p = cur_cmd->x.translate[*p];
}
@@ -1750,13 +1625,20 @@ execute_program(vec, input)
case '=':
output_missing_newline(&output_file);
fprintf(output_file.fp, "%lu\n",
- CAST(unsigned long)input->line_number);
+ (unsigned long)input->line_number);
flush_output(output_file.fp);
- break;
+ break;
- default:
- panic("INTERNAL ERROR: Bad cmd %c", cur_cmd->cmd);
- }
+ case 'F':
+ output_missing_newline(&output_file);
+ fprintf(output_file.fp, "%s\n",
+ input->in_file_name);
+ flush_output(output_file.fp);
+ break;
+
+ default:
+ panic("INTERNAL ERROR: Bad cmd %c", cur_cmd->cmd);
+ }
}
#ifdef EXPERIMENTAL_DASH_N_OPTIMIZATION
@@ -1867,10 +1749,10 @@ process_files(the_program, argv)
deallocate in order to avoid extraneous noise from
the allocator. */
release_append_queue();
- FREE(buffer.text);
- FREE(hold.text);
- FREE(line.text);
- FREE(s_accum.text);
+ free(buffer.text);
+ free(hold.text);
+ free(line.text);
+ free(s_accum.text);
#endif /*DEBUG_LEAKS*/
if (input.bad_count)
diff --git a/sed/fmt.c b/sed/fmt.c
index b2d2efb..3d15d69 100644
--- a/sed/fmt.c
+++ b/sed/fmt.c
@@ -23,18 +23,7 @@
#include <string.h>
#include <ctype.h>
#include <sys/types.h>
-
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#ifndef UINT_MAX
-# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
-#endif
-
-#ifndef INT_MAX
-# define INT_MAX ((int) (UINT_MAX >> 1))
-#endif
+#include <limits.h>
/* The following parameters represent the program's idea of what is
"best". Adjust to taste, subject to the caveats given. */
@@ -135,20 +124,20 @@ struct Word
/* Forward declarations. */
-static bool get_paragraph P_ ((void));
-static int get_line P_ ((int c));
-static int get_space P_ ((int c));
-static int copy_rest P_ ((int c));
-static bool same_para P_ ((int c));
-static void flush_paragraph P_ ((void));
-static void fmt_paragraph P_ ((void));
-static void check_punctuation P_ ((WORD *w));
-static COST base_cost P_ ((WORD *this));
-static COST line_cost P_ ((WORD *next, int len));
-static void put_paragraph P_ ((WORD *finish));
-static void put_line P_ ((WORD *w, int indent));
-static void put_word P_ ((WORD *w));
-static void put_space P_ ((int space));
+static bool get_paragraph (void);
+static int get_line (int c);
+static int get_space (int c);
+static int copy_rest (int c);
+static bool same_para (int c);
+static void flush_paragraph (void);
+static void fmt_paragraph (void);
+static void check_punctuation (WORD *w);
+static COST base_cost (WORD *this);
+static COST line_cost (WORD *next, int len);
+static void put_paragraph (WORD *finish);
+static void put_line (WORD *w, int indent);
+static void put_word (WORD *w);
+static void put_space (int space);
/* Option values. */
diff --git a/sed/mbcs.c b/sed/mbcs.c
index 5746fd5..964e352 100644
--- a/sed/mbcs.c
+++ b/sed/mbcs.c
@@ -24,7 +24,6 @@
int mb_cur_max;
bool is_utf8;
-#ifdef HAVE_MBRTOWC
/* Add a byte to the multibyte character represented by the state
CUR_STAT, and answer its length if a character is completed,
or -2 if it is yet to be completed. */
@@ -46,7 +45,6 @@ int brlen (ch, cur_stat)
return result;
}
-#endif
void
initialize_mbcs ()
@@ -57,10 +55,6 @@ initialize_mbcs ()
codeset_name = locale_charset ();
is_utf8 = (strcmp (codeset_name, "UTF-8") == 0);
-#ifdef HAVE_MBRTOWC
mb_cur_max = MB_CUR_MAX;
-#else
- mb_cur_max = 1;
-#endif
}
diff --git a/sed/regexp.c b/sed/regexp.c
index 39914de..bbeccb5 100644
--- a/sed/regexp.c
+++ b/sed/regexp.c
@@ -21,9 +21,7 @@
#include <ctype.h>
#include <string.h>
#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
+#include <stdlib.h>
#ifdef gettext_noop
# define N_(String) gettext_noop(String)
@@ -235,8 +233,8 @@ match_regex(regex, buf, buflen, buf_start_offset, regarray, regsize)
regex_last = regex;
#ifdef REG_PERL
- regmatch[0].rm_so = CAST(int)buf_start_offset;
- regmatch[0].rm_eo = CAST(int)buflen;
+ regmatch[0].rm_so = (int)buf_start_offset;
+ regmatch[0].rm_eo = (int)buflen;
ret = regexec (&regex->pattern, buf, regsize, regmatch, REG_STARTEND);
if (regsize)
@@ -264,6 +262,6 @@ release_regex(regex)
struct regex *regex;
{
regfree(&regex->pattern);
- FREE(regex);
+ free(regex);
}
#endif /*DEBUG_LEAKS*/
diff --git a/sed/sed.c b/sed/sed.c
index d9a238f..af985e6 100644
--- a/sed/sed.c
+++ b/sed/sed.c
@@ -1,5 +1,5 @@
/* GNU SED, a batch stream editor.
- Copyright (C) 1989,90,91,92,93,94,95,98,99,2002,2003,2006,2008,2009
+ Copyright (C) 1989,90,91,92,93,94,95,98,99,2002,2003,2006,2008,2009,2010
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -21,47 +21,28 @@
#include <stdio.h>
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#else
-# include <string.h>
-#endif /*HAVE_STRINGS_H*/
-#ifdef HAVE_MEMORY_H
-# include <memory.h>
-#endif
-
-#ifndef HAVE_STRCHR
-# define strchr index
-# define strrchr rindex
-#endif
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
#include "getopt.h"
-#ifndef BOOTSTRAP
-#ifndef HAVE_STDLIB_H
- extern char *getenv P_((const char *));
-#endif
-#endif
+#include "version-etc.h"
-#ifndef HAVE_STRTOUL
-# define ATOI(x) atoi(x)
-#else
-# define ATOI(x) strtoul(x, NULL, 0)
-#endif
+#define AUTHORS \
+ _("Jay Fenlason"), \
+ _("Tom Lord"), \
+ _("Ken Pizzini"), \
+ _("Paolo Bonzini")
char *program_name;
int extended_regexp_flags = 0;
+/* one-byte buffer delimiter */
+char buffer_delimiter = '\n';
+
/* If set, fflush(stdout) on every line output. */
-bool unbuffered_output = false;
+bool unbuffered = false;
/* If set, don't write out the line unless explicitly told to */
bool no_default_output = false;
@@ -75,8 +56,9 @@ bool follow_symlinks = false;
/* How do we edit files in-place? (we don't if NULL) */
char *in_place_extension = NULL;
-/* The mode to use to read files, either "rt" or "rb". */
-char *read_mode = "rt";
+/* The mode to use to read/write files, either "r"/"w" or "rb"/"wb". */
+char *read_mode = "r";
+char *write_mode = "w";
/* Do we need to be pedantically POSIX compliant? */
enum posixicity_types posixicity;
@@ -87,7 +69,7 @@ countT lcmd_out_line_len = 70;
/* The complete compiled SED program that we are going to run: */
static struct vector *the_program = NULL;
-static void usage P_((int));
+static void usage (int);
static void
contact(errmsg)
int errmsg;
@@ -106,7 +88,7 @@ Be sure to include the word ``%s'' somewhere in the ``Subject:'' field.\n"),
PACKAGE_BUGREPORT, PACKAGE);
}
-static void usage P_((int));
+static void usage (int);
static void
usage(status)
int status;
@@ -134,7 +116,7 @@ Usage: %s [OPTION]... {script-only-if-no-other-script} [input-file]...\n\
follow symlinks when processing in place\n"));
#endif
fprintf(out, _(" -i[SUFFIX], --in-place[=SUFFIX]\n\
- edit files in place (makes backup if extension supplied)\n"));
+ edit files in place (makes backup if SUFFIX supplied)\n"));
#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) || defined(MSDOS) || defined(__EMX__)
fprintf(out, _(" -b, --binary\n\
open files in binary mode (CR+LFs are not processed specially)\n"));
@@ -154,6 +136,8 @@ Usage: %s [OPTION]... {script-only-if-no-other-script} [input-file]...\n\
fprintf(out, _(" -u, --unbuffered\n\
load minimal amounts of data from the input files and flush\n\
the output buffers more often\n"));
+ fprintf(out, _(" -z, --null-data\n\
+ separate lines by NUL characters\n"));
fprintf(out, _(" --help display this help and exit\n"));
fprintf(out, _(" --version output version information and exit\n"));
fprintf(out, _("\n\
@@ -174,9 +158,9 @@ main(argc, argv)
char **argv;
{
#ifdef REG_PERL
-#define SHORTOPTS "bsnrRuEe:f:l:i::V:"
+#define SHORTOPTS "bsnrzRuEe:f:l:i::V:"
#else
-#define SHORTOPTS "bsnruEe:f:l:i::V:"
+#define SHORTOPTS "bsnrzuEe:f:l:i::V:"
#endif
static struct option longopts[] = {
@@ -189,6 +173,8 @@ main(argc, argv)
{"file", 1, NULL, 'f'},
{"in-place", 2, NULL, 'i'},
{"line-length", 1, NULL, 'l'},
+ {"null-data", 0, NULL, 'z'},
+ {"zero-terminated", 0, NULL, 'z'},
{"quiet", 0, NULL, 'n'},
{"posix", 0, NULL, 'p'},
{"silent", 0, NULL, 'n'},
@@ -232,7 +218,7 @@ main(argc, argv)
*/
if (cols)
{
- countT t = ATOI(cols);
+ countT t = atoi(cols);
if (t > 1)
lcmd_out_line_len = t-1;
}
@@ -252,6 +238,10 @@ main(argc, argv)
the_program = compile_file(the_program, optarg);
break;
+ case 'z':
+ buffer_delimiter = 0;
+ break;
+
case 'F':
follow_symlinks = true;
break;
@@ -275,7 +265,7 @@ main(argc, argv)
break;
case 'l':
- lcmd_out_line_len = ATOI(optarg);
+ lcmd_out_line_len = atoi(optarg);
break;
case 'p':
@@ -284,6 +274,7 @@ main(argc, argv)
case 'b':
read_mode = "rb";
+ write_mode = "wb";
break;
/* Undocumented, for compatibility with BSD sed. */
@@ -307,24 +298,13 @@ main(argc, argv)
break;
case 'u':
- unbuffered_output = true;
+ unbuffered = true;
break;
case 'v':
-#ifdef REG_PERL
- fprintf(stdout, _("super-sed version %s\n"), VERSION);
- fprintf(stdout, _("based on GNU sed version %s\n\n"), SED_FEATURE_VERSION);
-#else
- fprintf(stdout, _("GNU sed version %s\n"), VERSION);
-#endif
- fprintf(stdout, _("Copyright (C) %d Free Software Foundation, Inc.\n\
-This is free software; see the source for copying conditions. There is NO\n\
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,\n\
-to the extent permitted by law.\n\
-"), COPYRIGHT_YEAR);
- fputc('\n', stdout);
+ version_etc(stdout, program_name, PACKAGE_NAME, VERSION,
+ AUTHORS, (char *) NULL);
contact(false);
-
ck_fclose (NULL);
exit (0);
case 'h':
diff --git a/sed/sed.h b/sed/sed.h
index d657a42..2c6aff5 100644
--- a/sed/sed.h
+++ b/sed/sed.h
@@ -16,17 +16,11 @@
along with this program; if not, write to the Free Software
Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
#include "config.h"
-#endif
-
#include "basicdefs.h"
#include "regex.h"
-
-#ifndef BOOTSTRAP
#include <stdio.h>
#include "unlocked-io.h"
-#endif
#include "utils.h"
@@ -187,32 +181,36 @@ struct sed_cmd {
-void bad_prog P_((const char *why));
-size_t normalize_text P_((char *text, size_t len, enum text_types buftype));
-struct vector *compile_string P_((struct vector *, char *str, size_t len));
-struct vector *compile_file P_((struct vector *, const char *cmdfile));
-void check_final_program P_((struct vector *));
-void rewind_read_files P_((void));
-void finish_program P_((struct vector *));
-
-struct regex *compile_regex P_((struct buffer *b, int flags, int needed_sub));
-int match_regex P_((struct regex *regex,
- char *buf, size_t buflen, size_t buf_start_offset,
- struct re_registers *regarray, int regsize));
+void bad_prog (const char *why);
+size_t normalize_text (char *text, size_t len, enum text_types buftype);
+struct vector *compile_string (struct vector *, char *str, size_t len);
+struct vector *compile_file (struct vector *, const char *cmdfile);
+void check_final_program (struct vector *);
+void rewind_read_files (void);
+void finish_program (struct vector *);
+
+struct regex *compile_regex (struct buffer *b, int flags, int needed_sub);
+int match_regex (struct regex *regex,
+ char *buf, size_t buflen, size_t buf_start_offset,
+ struct re_registers *regarray, int regsize);
#ifdef DEBUG_LEAKS
-void release_regex P_((struct regex *));
+void release_regex (struct regex *);
#endif
-int process_files P_((struct vector *, char **argv));
+int process_files (struct vector *, char **argv);
-int main P_((int, char **));
+int main (int, char **);
-extern void fmt P_ ((const char *line, const char *line_end, int max_length, FILE *output_file));
+extern void fmt (const char *line, const char *line_end, int max_length, FILE *output_file);
extern int extended_regexp_flags;
-/* If set, fflush(stdout) on every line output. */
-extern bool unbuffered_output;
+/* one-byte buffer delimiter */
+extern char buffer_delimiter;
+
+/* If set, fflush(stdout) on every line output,
+ and turn off stream buffering on inputs. */
+extern bool unbuffered;
/* If set, don't write out the line unless explicitly told to. */
extern bool no_default_output;
@@ -232,8 +230,9 @@ extern countT lcmd_out_line_len;
/* How do we edit files in-place? (we don't if NULL) */
extern char *in_place_extension;
-/* The mode to use to read files, either "rt" or "rb". */
+/* The mode to use to read and write files, either "rt"/"w" or "rb"/"wb". */
extern char *read_mode;
+extern char *write_mode;
/* Should we use EREs? */
extern bool use_extended_syntax_p;
@@ -242,8 +241,6 @@ extern bool use_extended_syntax_p;
extern int mb_cur_max;
extern bool is_utf8;
-#ifdef HAVE_MBRTOWC
-#ifdef HAVE_BTOWC
#define MBRTOWC(pwc, s, n, ps) \
(mb_cur_max == 1 ? \
(*(pwc) = btowc (*(unsigned char *) (s)), 1) : \
@@ -253,13 +250,6 @@ extern bool is_utf8;
(mb_cur_max == 1 ? \
(*(s) = wctob ((wint_t) (wc)), 1) : \
wcrtomb ((s), (wc), (ps)))
-#else
-#define MBRTOWC(pwc, s, n, ps) \
- mbrtowc ((pwc), (s), (n), (ps))
-
-#define WCRTOMB(s, wc, ps) \
- wcrtomb ((s), (wc), (ps))
-#endif
#define MBSINIT(s) \
(mb_cur_max == 1 ? 1 : mbsinit ((s)))
@@ -270,12 +260,6 @@ extern bool is_utf8;
#define BRLEN(ch, ps) \
(mb_cur_max == 1 ? 1 : brlen (ch, ps))
-#else
-#define MBSINIT(s) 1
-#define MBRLEN(s, n, ps) 1
-#define BRLEN(ch, ps) 1
-#endif
-
-extern int brlen P_ ((int ch, mbstate_t *ps));
-extern void initialize_mbcs P_ ((void));
+extern int brlen (int ch, mbstate_t *ps);
+extern void initialize_mbcs (void);
diff --git a/sed/utils.c b/sed/utils.c
index 8c009e4..aa674fd 100644
--- a/sed/utils.c
+++ b/sed/utils.c
@@ -1,5 +1,5 @@
/* Functions from hack's utils library.
- Copyright (C) 1989, 1990, 1991, 1998, 1999, 2003, 2008, 2009
+ Copyright (C) 1989, 1990, 1991, 1998, 1999, 2003, 2008, 2009, 2011
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -21,20 +21,8 @@
#include <stdio.h>
#include <stdarg.h>
#include <errno.h>
-#ifndef errno
- extern int errno;
-#endif
-
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#else
-# include <string.h>
-#endif /* HAVE_STRINGS_H */
-
-#ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-#endif /* HAVE_STDLIB_H */
-
+#include <string.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -42,6 +30,7 @@
#include "utils.h"
#include "pathmax.h"
+#include "fwriting.h"
const char *myname;
@@ -58,7 +47,7 @@ struct open_file
};
static struct open_file *open_files = NULL;
-static void do_ck_fclose P_((FILE *fp));
+static void do_ck_fclose (FILE *fp);
/* Print an error message and exit */
@@ -69,15 +58,7 @@ panic(const char *str, ...)
fprintf(stderr, "%s: ", myname);
va_start(ap, str);
-#ifndef HAVE_VPRINTF
-# ifndef HAVE_DOPRNT
- fputs(str, stderr); /* not great, but perhaps better than nothing... */
-# else /* HAVE_DOPRNT */
- _doprnt(str, &ap, stderr);
-# endif /* HAVE_DOPRNT */
-#else /* HAVE_VFPRINTF */
vfprintf(stderr, str, ap);
-#endif /* HAVE_VFPRINTF */
va_end(ap);
putc('\n', stderr);
@@ -101,7 +82,7 @@ panic(const char *str, ...)
/* Internal routine to get a filename from open_files */
-static const char *utils_fp_name P_((FILE *fp));
+static const char *utils_fp_name (FILE *fp);
static const char *
utils_fp_name(fp)
FILE *fp;
@@ -132,7 +113,7 @@ register_open_file (fp, name, temp)
{
if (fp == p->fp)
{
- FREE(p->name);
+ free(p->name);
break;
}
}
@@ -193,9 +174,10 @@ ck_fdopen(fd, name, mode, fail)
}
FILE *
-ck_mkstemp (p_filename, tmpdir, base)
+ck_mkstemp (p_filename, tmpdir, base, mode)
char **p_filename;
- char *base, *tmpdir;
+ const char *base, *tmpdir;
+ const char *mode;
{
char *template;
FILE *fp;
@@ -219,15 +201,17 @@ ck_mkstemp (p_filename, tmpdir, base)
sprintf (template, "%s/%sXXXXXX", tmpdir, base);
/* The ownership might change, so omit some permissions at first
- so unauthorized users cannot nip in before the file is ready. */
+ so unauthorized users cannot nip in before the file is ready.
+
+ mkstemp forces O_BINARY on cygwin, so use mkostemp instead. */
save_umask = umask (0700);
- fd = mkstemp (template);
+ fd = mkostemp (template, 0);
umask (save_umask);
if (fd == -1)
panic(_("couldn't open temporary file %s: %s"), template, strerror(errno));
*p_filename = template;
- fp = fdopen (fd, "w");
+ fp = fdopen (fd, mode);
register_open_file (fp, template, true);
return fp;
}
@@ -235,7 +219,7 @@ ck_mkstemp (p_filename, tmpdir, base)
/* Panic on failing fwrite */
void
ck_fwrite(ptr, size, nmemb, stream)
- const VOID *ptr;
+ const void *ptr;
size_t size;
size_t nmemb;
FILE *stream;
@@ -250,7 +234,7 @@ ck_fwrite(ptr, size, nmemb, stream)
/* Panic on failing fread */
size_t
ck_fread(ptr, size, nmemb, stream)
- VOID *ptr;
+ void *ptr;
size_t size;
size_t nmemb;
FILE *stream;
@@ -263,16 +247,23 @@ ck_fread(ptr, size, nmemb, stream)
}
size_t
-ck_getline(text, buflen, stream)
+ck_getdelim(text, buflen, buffer_delimiter, stream)
char **text;
size_t *buflen;
+ char buffer_delimiter;
FILE *stream;
{
- int result;
- if (!ferror (stream))
- result = getline (text, buflen, stream);
+ ssize_t result;
+ bool error;
+
+ error = ferror (stream);
+ if (!error)
+ {
+ result = getdelim (text, buflen, buffer_delimiter, stream);
+ error = ferror (stream);
+ }
- if (ferror (stream))
+ if (error)
panic (_("read error on %s: %s"), utils_fp_name(stream), strerror(errno));
return result;
@@ -283,6 +274,9 @@ void
ck_fflush(stream)
FILE *stream;
{
+ if (!fwriting(stream))
+ return;
+
clearerr(stream);
if (fflush(stream) == EOF && errno != EBADF)
panic("couldn't flush %s: %s", utils_fp_name(stream), strerror(errno));
@@ -306,8 +300,8 @@ ck_fclose(stream)
{
do_ck_fclose (cur->fp);
prev->link = cur->link;
- FREE(cur->name);
- FREE(cur);
+ free(cur->name);
+ free(cur);
}
else
prev = cur;
@@ -447,27 +441,27 @@ ck_rename (from, to, unlink_if_fail)
/* Panic on failing malloc */
-VOID *
+void *
ck_malloc(size)
size_t size;
{
- VOID *ret = calloc(1, size ? size : 1);
+ void *ret = calloc(1, size ? size : 1);
if (!ret)
panic("couldn't allocate memory");
return ret;
}
/* Panic on failing realloc */
-VOID *
+void *
ck_realloc(ptr, size)
- VOID *ptr;
+ void *ptr;
size_t size;
{
- VOID *ret;
+ void *ret;
if (size == 0)
{
- FREE(ptr);
+ free(ptr);
return NULL;
}
if (!ptr)
@@ -488,24 +482,15 @@ ck_strdup(str)
}
/* Return a malloc()'d copy of a block of memory */
-VOID *
+void *
ck_memdup(buf, len)
- const VOID *buf;
+ const void *buf;
size_t len;
{
- VOID *ret = ck_malloc(len);
+ void *ret = ck_malloc(len);
return memcpy(ret, buf, len);
}
-/* Release a malloc'd block of memory */
-void
-ck_free(ptr)
- VOID *ptr;
-{
- if (ptr)
- free(ptr);
-}
-
/* Implement a variable sized buffer of `stuff'. We don't know what it is,
nor do we care, as long as it doesn't mind being aligned by malloc. */
@@ -543,7 +528,7 @@ size_buffer(b)
return b->length;
}
-static void resize_buffer P_((struct buffer *b, size_t newlen));
+static void resize_buffer (struct buffer *b, size_t newlen);
static void
resize_buffer(b, newlen)
struct buffer *b;
@@ -609,6 +594,6 @@ free_buffer(b)
struct buffer *b;
{
if (b)
- FREE(b->b);
- FREE(b);
+ free(b->b);
+ free(b);
}
diff --git a/sed/utils.h b/sed/utils.h
index d3f431d..4b44cd8 100644
--- a/sed/utils.h
+++ b/sed/utils.h
@@ -20,31 +20,31 @@
#include "basicdefs.h"
-void panic P_((const char *str, ...));
-
-FILE *ck_fopen P_((const char *name, const char *mode, int fail));
-FILE *ck_fdopen P_((int fd, const char *name, const char *mode, int fail));
-void ck_fwrite P_((const VOID *ptr, size_t size, size_t nmemb, FILE *stream));
-size_t ck_fread P_((VOID *ptr, size_t size, size_t nmemb, FILE *stream));
-void ck_fflush P_((FILE *stream));
-void ck_fclose P_((FILE *stream));
-const char *follow_symlink P_((const char *path));
-size_t ck_getline P_((char **text, size_t *buflen, FILE *stream));
-FILE * ck_mkstemp P_((char **p_filename, char *tmpdir, char *base));
-void ck_rename P_((const char *from, const char *to, const char *unlink_if_fail));
-
-VOID *ck_malloc P_((size_t size));
-VOID *xmalloc P_((size_t size));
-VOID *ck_realloc P_((VOID *ptr, size_t size));
-char *ck_strdup P_((const char *str));
-VOID *ck_memdup P_((const VOID *buf, size_t len));
-void ck_free P_((VOID *ptr));
-
-struct buffer *init_buffer P_((void));
-char *get_buffer P_((struct buffer *b));
-size_t size_buffer P_((struct buffer *b));
-char *add_buffer P_((struct buffer *b, const char *p, size_t n));
-char *add1_buffer P_((struct buffer *b, int ch));
-void free_buffer P_((struct buffer *b));
+void panic (const char *str, ...);
+
+FILE *ck_fopen (const char *name, const char *mode, int fail);
+FILE *ck_fdopen (int fd, const char *name, const char *mode, int fail);
+void ck_fwrite (const void *ptr, size_t size, size_t nmemb, FILE *stream);
+size_t ck_fread (void *ptr, size_t size, size_t nmemb, FILE *stream);
+void ck_fflush (FILE *stream);
+void ck_fclose (FILE *stream);
+const char *follow_symlink (const char *path);
+size_t ck_getdelim (char **text, size_t *buflen, char buffer_delimiter, FILE *stream);
+FILE * ck_mkstemp (char **p_filename, const char *tmpdir, const char *base,
+ const char *mode);
+void ck_rename (const char *from, const char *to, const char *unlink_if_fail);
+
+void *ck_malloc (size_t size);
+void *xmalloc (size_t size);
+void *ck_realloc (void *ptr, size_t size);
+char *ck_strdup (const char *str);
+void *ck_memdup (const void *buf, size_t len);
+
+struct buffer *init_buffer (void);
+char *get_buffer (struct buffer *b);
+size_t size_buffer (struct buffer *b);
+char *add_buffer (struct buffer *b, const char *p, size_t n);
+char *add1_buffer (struct buffer *b, int ch);
+void free_buffer (struct buffer *b);
extern const char *myname;