summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* gnulib: update to latest and adapt to modified dfa APIJim Meyering2016-12-181-0/+1
| | | | | | | | * sed/regexp.c (compile_regex_1): Do away with use of DFA_CASE_FOLD. This gnulib update pulls in a dfa module in which that symbol no longer exists. Instead, it uses RE_ICASE in syntax bits. * m4/.gitignore: Add files created by running bootstrap. * lib/.gitignore: Likewise.
* build: avoid "make distcheck" failure due to leftover .Po filesJim Meyering2016-11-271-7/+0
| | | | | | | | | | | | The following definitions caused trouble for no gain. They caused some .o file names to have a long additional prefix and even resulted in some .Po files not being removed by "make distclean" when building with recent automake. The only reason to use these definitions was -- long ago -- to require different compiler options for files in lib/ than elsewhere. That is no longer necessary. * lib/local.mk (lib_libsed_a_CPPFLAGS): Remove definition. (lib_libsed_a_CFLAGS, lib_libsed_a_LIBADD): Likewise. (lib_libsed_a_DEPENDENCIES): Likewise.
* sed: fix multi-line regex matching with -zNorihiro Tanaka2016-11-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sed incorrectly matches the anchor '^' to a newline character (ASCII 10) despite using NUL line terminators (-z). See https://bugs.gnu.org/24615 . Previous (incorrect) behavior: $ printf "a\0b\0" | sed -z 'N;s/^/X/mg;' | od -An -a X a nul b nul With this fix: $ printf "a\0b\0" | sed -z 'N;s/^/X/mg;' | od -An -a X a nul X b nul Current regex engine can not handle NUL multiline anchors. Implement such search manually (by breaking the pattern into separate NUL-terminated lines) and searching each one individually. * NEWS: Mention it. * sed/regexp.c (compile_regex_1): Don't use newline_anchor of regex, if the buffer delimiter is not newline character. (match_regex): Do above case line-by-line. * testsuite/zero-anchor.good, testsuite/zero-anchor.inp, testsuite/zero-anchor.sed: New test. * testsuite/local.mk: Add the test. * testsuite/Makefile.tests: Add the test. * bootstrap.conf: Add memrchr. * lib/.gitignore, m4/.gitignore: Ignore memrchr files.
* gnulib: update to latestJim Meyering2016-10-021-0/+5
|
* dfa: reflect move of dfa code to new gnulib moduleJim Meyering2016-09-111-0/+8
| | | | | | | | | | | | | | | * bootstrap.conf (gnulib_modules): Add dfa. * sed/dfa.c: Remove file. * sed/dfa.h: Likewise. * sed/local.mk (sed_sed_SOURCES): Remove dfa.c. (NOINST_HEADERS): Remove dfa.h. * sed/regexp.c (compile_regex_1): Use new dfasyntax API. * sed/sed.c (localeinfo): New global. (main): Call init_localeinfo to initialize it. * sed/sed.h: Include localeinfo.h and declare the new global. * lib/.gitignore: Ignore new gnulib-imported files. * m4/.gitignore: Likewise. * po/POTFILES.in: s,sed/dfa.c,lib/dfa.c,
* maint: fix distclean-vs-excess-.Po files more cleanlyJim Meyering2016-08-271-5/+0
| | | | | | | | | | | * doc/local.mk (distclean-local): Remove rule. Moved to ... * Makefile.am (distclean-local): ...here, and add a command to remove all .deps directories. It could have stayed in that .mk file, but since with this change, it is no longer specific to doc/, the top level makes more sense. * lib/local.mk (MOSTLYCLEANFILES): Remove this. Covered by the above. Reported by Assaf Gordon in https://lists.gnu.org/archive/html/sed-devel/2016-08/msg00019.html
* build: fix sed.1 dependency; work with latest automakeJim Meyering2016-08-141-0/+5
| | | | | | | | | | | | | | | | | | | * doc/local.mk (doc/sed.1): Depend not on sed.c, but on the binary that help2man must run. Also depend on .version, to be sure we pick up a version change. Also, be careful not to write directly to $@: instead write to $@-t, and make read-only to mark as generated, and then, only if all is well, rename atomically to $@. Also, prefix commands with $(AM_V_GEN) and $(AM_V_at) and ensure that doc/ exists via $(MKDIR_P). (distclean-local): New target. Use this instead of ... (dist-hook-man-page): ... this. Remove rule. (SEDBIN): Remove unnecessary $(top_builddir)/ prefix. (doc/sed.texi, doc/s-texi): Remove some uses of $(top_builddir). Replace others with $(srcdir). * Makefile (dist-hook): remove dependency on dist-hook-man-page. * lib/local.mk (MOSTLYCLEANFILES): Arrange for lib/.deps/*.Po to be removed as part of "make distclean", so that make distcheck no longer fails when using latest automake.
* maint: update .gitignore after bootstrapAssaf Gordon2016-07-261-0/+3
| | | | | | | | | Added by running ./bootstrap on a clean sed repository. * build-aux/.gitignore: Add config.rpath. * lib/.gitignore: Add additional gnulib C files. * m4/.gitignore: Add additional gnulib m4 files. * po/.gitignore: Add additional PO-related files.
* build: switch to non-recursive makefileAssaf Gordon2016-07-242-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * .gitignore: Ignore '.dirstamp' files * bootstrap.conf: Add 'non-recursive-gnulib-prefix-hack' gnulib module. Add missing 'stdalign' module. (bootstrap_post_import_hook): Use module to adjust gnulib.mk file. * configure.ac: Add 'subdir-objects' automake option, don't generate makefiles in subdirectories. Adjust path of XFAIL tests. * Makefile.am: Include 'local.mk' files, adjust for non-recursive make. * doc/Makefile.am: Rename to ... * doc/local.mk: Adjust paths. Rename SED to SEDBIN variable, to avoid overriding the default system-wide SED value which is automatically set by autotools. * lib/Makefile.am: Rename to ... * lib/local.mk: Adjust paths. * lib/.gitignore: Ignore 'stdalign.h' from gnulib module. * sed/Makefile.am: Rename to ... * sed/local.mk: Adjust paths. * testsuite/Makefile.am: Rename to ... * testsuite/local.mk: Adjust paths. * testsuite/init.cfg: Move to ... * init.cfg: ... here. Moved to avoid changing the path in init.sh, and to keep the same directory structure as coreutils. (require_en_utf8_locale_): Adjust path for get-mb-cur-max executable. (require_ja_shiftjis_locale_,require_valid_ja_shiftjis_locale_): Adjust path for test-mbrtowc executable. * m4/.gitignore: Add gnulib's non-recusive-make module. * testsuite/runtest: Adjust paths of Makefile.tests and dir variables, Skip utility program 'get-mb-cur-max' which is not a standalone test. * testsuite/Makefile.tests: Adjust path of sed exeutable. * testsuite/eval.sed, testsuite/eval.good: Adjust path of sed executable. * testsuite/cmd-R.sh, testsuite/cmd-l.sh, testsuite/colon-with-no-label.sh, testsuite/comment-n.sh, testsuite/compile-errors.sh, testsuite/compile-tests.sh, testsuite/convert-number.sh, testsuite/execute-tests.sh, testsuite/follow-symlinks-stdin.sh, testsuite/follow-symlinks.sh, testsuite/help-version.sh, testsuite/in-place-hyphen.sh, testsuite/in-place-suffix-backup.sh, testsuite/invalid-mb-seq-UMR.sh, testsuite/mb-bad-delim.sh, testsuite/mb-charclass-non-utf8.sh, testsuite/mb-match-slash.sh, testsuite/mb-y-translate.sh, testsuite/normalize-text.sh, testsuite/nulldata.sh, testsuite/panic-tests.sh, testsuite/posix-char-class.sh, testsuite/posix-mode-N.sh, testsuite/posix-mode-addr.sh, testsuite/posix-mode-bad-ref.sh, testsuite/posix-mode-s.sh, testsuite/range-overlap.sh, testsuite/recursive-escape-c.sh, testsuite/regex-errors.sh, testsuite/stdin-prog.sh, testsuite/subst-mb-incomplete.sh, testsuite/subst-options.sh, testsuite/subst-replacement.sh, testsuite/temp-file-cleanup.sh, testsuite/unbuffered.sh: Adjust paths of init.sh, sed executable.
* tests: skip tests upon buggy mbrtowc implementationsAssaf Gordon2016-07-061-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Sed tests purposefully use invalid non-utf8 multibyte sequences to test sed's handling of invalid input/program. Some implementations wrongly accept invalid sequences, causing false alarms. Add a test program to detect such buggy implementations and skip the tests if needed. See discussion in: http://lists.gnu.org/archive/html/sed-devel/2016-07/msg00005.html http://lists.gnu.org/archive/html/sed-devel/2016-07/msg00000.html http://lists.gnu.org/archive/html/sed-devel/2016-06/msg00031.html http://lists.gnu.org/archive/html/sed-devel/2016-06/msg00014.html * bootstrap.conf: Add gnulib's closeout module. * m4/.gitignore, lib/.gitignore, po/POTFILES.in: Adjust after adding closeout module. * testsuite/Makefile.am (check_PROGRAMS): Add new program. * testsuite/test-mbrtowc.c: New program. * testsuite/init.cfg (require_valid_ja_eucjp_locale_) (require_valid_ja_shiftjis_locale_): New functions. Call test-mbrtowc with known invalid multibyte sequences to ensure implementation is not buggy and rejects them; Skip test otherwise. * testsuite/invalid-mb-seq-UMR.sh: Use require_valid_ja_eucjp_locale_. * testsuite/mb-charclass-non-utf8.sh: Use require_valid_ja_shiftjis_locale_.
* maint: update copyright year, bootstrap, init.shJim Meyering2016-01-011-1/+1
| | | | | | | | Run "make update-copyright" and then... * gnulib: Update to latest. * tests/init.sh: Update from gnulib. * bootstrap: Likewise.
* maint: update copyright year ranges to include 2015; update gnulibJim Meyering2015-01-012-1/+2
|
* build: avoid warning about unused fchown resultJim Meyering2014-12-011-0/+1
| | | | | | | | * sed/execute.c: Include "ignore-value.h". (closedown): Explicitly ignore fchown return value. * bootstrap.conf (gnulib_modules): Add ignore-value. * lib/.gitignore: Ignore the new .h file. * .gitignore: Ignore all **~ backup files.
* maint: enable sc_program_name syntax checkJim Meyering2014-11-301-0/+2
| | | | | | | | | * cfg.mk (local-checks-to-skip): Remove its exemption. * sed/sed.c: Include progname.h". (program_name): Remove now-unnecessary declaration. (main): Call set_program_name. * bootstrap.conf (gnulib_modules): Add progname. * lib/.gitignore: Append the two new names.
* maint: update autogenerated .gitignore filesJim Meyering2014-11-301-0/+5
|
* maint: update build/gnulib infrastructure; generate ChangeLogJim Meyering2014-11-301-4/+29
| | | | | | | | | | | | * ChangeLog-2014: Renamed from ChangeLog. * po/ChangeLog-2014: Renamed from po/ChangeLog. * Makefile.am (EXTRA_DIST): Add the two new file names. (dist-hook): Generate ChangeLog at tarball-creation time. (gen-ChangeLog): New rule. Just like the one in coreutils and grep. * bootstrap.conf (gnulib_modules): Add the modules, readme-release and gitlog-to-changelog, and revamp to be much more like grep and coreutils. * lib/Makefile.am: Update.
* Update to latest gnulib.Paolo Bonzini2012-12-221-0/+8
| | | | | | | 2012-12-21 Paolo Bonzini <bonzini@gnu.org> * gnulib: Update. * testsuite/version.gin: Regenerate.
* update gnulib to latestPaolo Bonzini2012-03-161-0/+14
| | | | | | 2012-03-16 Paolo Bonzini <bonzini@gnu.org> * gnulib: Update.
* update .gitignore filesPaolo Bonzini2011-08-291-0/+8
|
* update .gitignore filesPaolo Bonzini2010-10-311-0/+3
|
* use version-etc-fsfPaolo Bonzini2010-08-301-0/+43
| | | | | | | | | | | | 2010-08-30 Paolo Bonzini <bonzini@gnu.org> * Makefile.am (dist-hook): Remove COPYRIGHT_YEAR check. * autoboot.conf (gnulib_modules): Add version-etc-fsf. * configure.ac (COPYRIGHT_YEAR): Remove. Change package name to "GNU sed". * doc/sed.1: Regenerate. * sed/sed.c (AUTHORS): New. (main): Use version_etc.
* use mkostemp(template, 0) instead of mkstemp to work around Cygwin oddityPaolo Bonzini2010-07-161-1/+19
| | | | | | | | | | | 2010-07-16 Paolo Bonzini <bonzini@gnu.org> * autoboot.conf (gnulib_modules): Replace mkstemp with mkostemp. * bootstrap.sh.in: Compile mkostemp.c instead of mkstemp.c. * gnulib: Update. * NEWS: Mention change. * sed/utils.c (ck_mkstemp): Use mkostemp to work around Cygwin oddity. Reported by Stepan Kasal.
* bump version number to 4.2.1v4.2.1Paolo Bonzini2009-06-271-0/+1
| | | | | | | | | 2009-06-27 Paolo Bonzini <bonzini@gnu.org> * configure.ac: Bump version. * NEWS: Bump version. * gnulib: Update. * doc/sed.1: Regenerate.
* preserve security contexts too on sed -iPaolo Bonzini2009-06-261-0/+16
| | | | | | | 2009-06-25 Paolo Bonzini <bonzini@gnu.org> * autoboot.conf: Add selinux-h. * execute.c: Copy over file creation context before creating a new file.
* use gnulib's emulation for mb functionsPaolo Bonzini2008-12-221-0/+8
| | | | | | | 2008-12-22 Paolo Bonzini <bonzini@gnu.org> * autoboot.conf: Request modules emulating mb functions. * configure.ac: Do not look for mb functions here.
* switch to external gettextJim Meyering2008-10-032-2/+2
| | | | | | | | | | 2008-10-03 Paolo Bonzini <bonzini@gnu.org> Jim Meyering <meyering@redhat.com> * Makefile.am: Remove intl subdir. Require Automake 1.10. * configure.ac: Remove useless macros, switch to external gettext. * lib/Makefile.am: Remove intl subdir from CPPFLAGS. * sed/Makefile.am: Remove intl subdir from CPPFLAGS.
* update gnulibPaolo Bonzini2008-09-281-24/+2
| | | | | | | | | | 2008-09-28 Paolo Bonzini <bonzini@gnu.org> * basicdefs.h: Replace alloca cruft with alloca.h. * bootstrap.sh.in: Update for new gnulib. * bootstrap.sh: Update for new gnulib. * configure.ac: Move gnulib macros earlier. * sed/execute.c: Do not include acl.h when bootstrapping.
* gnulib removed strverscmp.cPaolo Bonzini2008-08-201-1/+0
| | | | | | 2008-08-19 Paolo Bonzini <bonzini@gnu.org> * sed/compile.c: Do not include strverscmp.c.
* update .gitignore filesPaolo Bonzini2008-07-111-0/+2
|
* commit new .gitignore files produced by autobootPaolo Bonzini2008-01-161-21/+36
|
* upgrade autobootPaolo Bonzini2008-01-161-10/+3
|
* update .gitignore for more recent gnulibPaolo Bonzini2008-01-161-0/+13
|
* portability fixes from Bruno HaiblePaolo Bonzini2008-01-091-0/+4
| | | | | | | | | | 2006-12-22 Bruno Haible <bruno@clisp.org> * sed/utils.c: Include pathmax. * sed/mbcs.c: Use local_charset. * sed/execute.c: Copy with padding after the mbstate_t member. git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-90
* gnulibify part 2, use gnulib-tool in autoboot and remove PO files from repoPaolo Bonzini2008-01-091-8/+2
| | | | git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-76
* gnulib .gitignore filesPaolo Bonzini2008-01-092-148/+76
|
* gnulibify and add ACL supportPaolo Bonzini2008-01-0925-15960/+156
| | | | | | | | | | 2006-09-24 Paolo Bonzini <bonzini@gnu.org> * sed/execute.c: Support ACLs. * lib/utils.c: Move... * sed/utils.c: ... here, and remove xmalloc. git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-74
* treat cygwin CR/LF correctly (and by design, not by chance)Paolo Bonzini2008-01-093-27/+51
| | | | | | | | | | | | | | | | | | | | | 2006-08-03 Paolo Bonzini <bonzini@gnu.org> Corinna Vinschen <vinschen@redhat.com> * lib/getline.c (getline): Remove Windows special casing. * lib/utils.c (register_open_file, ck_fdopen): New. (ck_fopen, ck_mkstemp): Use register_open_file. * lib/utils.h (ck_fdopen): New. * sed/execute.c (open_next_file): Reopen stdin. * sed/sed.h (read_mode): New. * sed/sed.c (read_mode): New. (main): Set it on --binary. (usage): Document --binary. * sed/compile.c (get_openfile): Change second argument to char and turn it into a string within the function. Adjust callers. * sed/execute.c (dump_append_queue, open_next_file): Use it as mode for ck_fopen. git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-71
* don't rely on malloc(0) != NULLPaolo Bonzini2008-01-091-2/+2
| | | | git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-69
* robustify bootstrap process, ensure distribution of updated boostrap.shPaolo Bonzini2008-01-091-1/+22
| | | | | | | | | 2006-07-13 Paolo Bonzini <bonzini@gnu.org> * bootstrap.sh.in: Add a few autoconfy tests. * Makefile.am: Update distributed bootstrap.sh. git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-68
* Fix compilation on non-GCC compilers, update po filesPaolo Bonzini2008-01-092-2/+11
| | | | | | | | 2006-05-15 Hans-Bernhard Bröker <broeker@physik.rwth-aachen.de> * sed/basicdefs.h (OB_MALLOC): Turn VCAST into void * cast. git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-66
* merge with glibc regexPaolo Bonzini2008-01-095-946/+658
| | | | git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-59
* add LANG_SORBIAN and other mingw fixesPaolo Bonzini2008-01-091-0/+4
| | | | git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-57
* update regex from upstreamPaolo Bonzini2008-01-096-287/+310
| | | | | | | | | | | | | 2005-09-07 Paolo Bonzini <bonzini@gnu.org> * lib/regcomp.c: Update from upstream. * lib/regex.c: Update from upstream. * lib/regex_.h: Update from upstream. * lib/regex_internal.c: Update from upstream. * lib/regex_internal.h: Update from upstream. * lib/regexec.c: Update from upstream. git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-54
* merge regex with glibc and adjust doc/.arch-inventoryPaolo Bonzini2008-01-096-42/+74
| | | | git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-51
* more updates to the FSF addressPaolo Bonzini2008-01-0912-12/+12
| | | | git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-50
* update FSF addressPaolo Bonzini2008-01-0919-26/+26
| | | | git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-49
* fix crash on /\(\)/xPaolo Bonzini2008-01-092-0/+6
| | | | | | | | | | 2005-02-10 Paolo Bonzini <bonzini@gnu.org> * lib/regcomp.c (lower_subexp): Do not optimize empty subexpressions even with REG_NOSUB. * testsuite/SPENCER.tests: Add a previously failing testcase. git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-43
* include config.h from within obstack.hPaolo Bonzini2008-01-091-0/+4
| | | | | | | | 2005-02-08 Paolo Bonzini <bonzini@gnu.org> * lib/obstack.h: include config.h. git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-41
* finally resync with glibcPaolo Bonzini2008-01-095-31/+37
| | | | git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-38
* fix meaning of \BPaolo Bonzini2008-01-092-6/+9
| | | | | | | | | | | | | 2005-01-26 Paolo Bonzini <bonzini@gnu.org> * posix/regcomp.c (peek_token): Fix ctx_type for \B. (parse_expression): Lower token->opr.ctx_type == NOT_WORD_DELIM. * posix/regex_internal.h (re_context_type): Add NOT_WORD_DELIM and OUTSIDE_WORD. * posix/PCRE.tests: Adjust \B tests to check if it matches outside a word. git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-36