summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* document difference between "e" and "r" commandsssedPaolo Bonzini2012-07-252-3/+12
| | | | | | | 2012-07-25 Paolo Bonzini <bonzini@gnu.org> * doc/sed-in.texi: Document difference between "e" and "r" commands.
* Remove bootstrap.sh from Makefile.amJim Hill2012-04-302-6/+6
| | | | | * Makefile.am (noinst_DATA, dist-hook): build failed after git clean -dfx finish bootstrap.sh removal.
* fix \x26 on RHS of s commandPaolo Bonzini2012-04-134-22/+37
| | | | | | | | | | | 2012-04-13 Paolo Bonzini <bonzini@gnu.org> * sed/compile.c (convert_number): Remove default_char argument, expect buf to point to it. Remove maxdigits argument and compute it on the fly. (normalize_text): Unify calls to convert_number under the convert label. For TEXT_REPLACEMENT add a backslash to the output if convert_number returns ch == '&'.
* switch to the wonderful world of function prototypesPaolo Bonzini2012-03-169-138/+128
| | | | | | | | | | | | | 2012-03-16 Paolo Bonzini <bonzini@gnu.org> * basicdefs.h (P_): Remove. * sed/compile.c: Adjust. * sed/execute.c: Likewise. * sed/fmt.c: Likewise. * sed/sed.c: Likewise. * sed/sed.h: Likewise. * sed/utils.c: Likewise. * sed/utils.h: Likewise.
* simplify the code handling \l and \uPaolo Bonzini2012-03-162-7/+10
| | | | | | | 2011-05-27 Paolo Bonzini <bonzini@gnu.org> * sed/execute.c (append_replacement, do_subst): Further simplification.
* remove ck_freePaolo Bonzini2012-03-167-33/+31
| | | | | | | | | | | 2012-03-16 Paolo Bonzini <bonzini@gnu.org> * basicdefs.h (FREE): Remove. * sed/compile.c: Adjust. * sed/execute.c: Adjust. * sed/regexp.c: Adjust. * sed/utils.c: Adjust, remove ck_free. * sed/utils.h: Adjust, remove ck_free.
* rip out old macrosPaolo Bonzini2012-03-167-89/+65
| | | | | | | | | | | 2012-03-16 Paolo Bonzini <bonzini@gnu.org> * basicdefs.h (CAST, VCAST, VOID, MEMCPY, MEMMOVE): Rip out. * sed/compile.c: Adjust. * sed/execute.c: Adjust. * sed/regexp.c: Adjust. * sed/utils.c: Adjust. * sed/utils.h: Adjust.
* unconditionally compile for MBCSPaolo Bonzini2012-03-164-73/+6
| | | | | | | | 2012-03-16 Paolo Bonzini <bonzini@gnu.org> * sed/execute.c: Unconditionally compile for MBCS. * sed/mbcs.c: Unconditionally compile for MBCS. * sed/sed.h: Unconditionally compile for MBCS.
* clean up header inclusionsPaolo Bonzini2012-03-168-147/+30
| | | | | | | | | | | | 2012-03-16 Paolo Bonzini <bonzini@gnu.org> * basicdefs.h: Enjoy gnulib's headers. * sed/compile.c: Likewise. * sed/execute.c: Likewise. * sed/regexp.c: Likewise. * sed/sed.c: Likewise. * sed/sed.h: Likewise. * sed/utils.c: Likewise.
* remove bootstrap scriptPaolo Bonzini2012-03-169-411/+13
| | | | | | | | | | | | | 2012-03-16 Paolo Bonzini <bonzini@gnu.org> * bootstrap.sh.in: Remove. * bootstrap.sh: Remove. * configure.ac: Do not create bootstrap.sh. * basicdefs.h [BOOTSTRAP]: Remove guards. * pcre/pcre.h [BOOTSTRAP]: Remove guards. * sed/execute.c [BOOTSTRAP]: Remove guards. * sed/sed.c [BOOTSTRAP]: Remove guards. * sed/sed.h [BOOTSTRAP]: Remove guards.
* synchronize SELinux code with GNU sedPaolo Bonzini2012-03-162-0/+20
| | | | | | 2012-03-16 Paolo Bonzini <bonzini@gnu.org> * execute.c (open_next_file): Save/restore file creation context.
* avoid compiler warningEric Blake2012-03-164-5/+14
| | | | * sed/sed.c (includes): Supply missing header.
* update gnulib to latestPaolo Bonzini2012-03-165-0/+54
| | | | | | 2012-03-16 Paolo Bonzini <bonzini@gnu.org> * gnulib: Update.
* sed(1): document address behavior across input filesMike Frysinger2012-03-163-4/+15
| | | | | | | 2012-03-16 Paolo Bonzini <bonzini@gnu.org> * doc/sed.x: Document address behavior across input files. * doc/sed.1: Regenerate.
* ignore compiled object filesMike Frysinger2012-03-161-0/+3
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* do not open input files with "rt" mode, do not assume "rt" is supportedPaolo Bonzini2012-03-164-3/+39
| | | | | | | | 2012-02-13 Paolo Bonzini <bonzini@gnu.org> * configure.ac: Test whether fopen("foo", "rt") works. * sed/compile.c: Do not open scripts with "rt" mode if it doesn't. * sed/sed.c: Never open input files with "rt" mode.
* add -z/--null-dataPaolo Bonzini2012-03-1610-23/+77
| | | | | | | | | | | | | | | 2012-02-05 Paolo Bonzini <bonzini@gnu.org> Jim Hill <gjthill@gmail.com> * autoboot.conf: Change getline to getdelim. * doc/sed-in.texi: Document -z/--null-data. * doc/sed.texi: Regenerate. * sed/execute.c: Change '\n' to buffer_delimiter. * sed/sed.c: Add support for -z/--null-data. * sed/sed.h: Add buffer_delimiter. * sed/utils.c: Change ck_getline to ck_getdelim. * sed/utils.h: Change ck_getline to ck_getdelim. * NEWS: Document new option.
* use "w" or "wb" modes for sed -i, s///w, `w' and `W' depending on --binaryPaolo Bonzini2012-03-167-9/+26
| | | | | | | | | | | | | 2010-07-18 Paolo Bonzini <bonzini@gnu.org> * sed.c (write_mode): New. (main): Initialize it to "wb" if --binary is passed. * sed.h (write_mode): New. * compile.c (mark_subst_opts, compile_program): Use it instead of "w". * execute.c (open_next_file): Pass write_mode to ck_mkstemp. * utils.c (ck_mkstemp): Accept mode, pass it to fdopen. Constify. * utils.h (ck_mkstemp): Adjust prototype.
* Let --posix turn off nonportable scripts ending in backslash.Ralf Wildenhues2012-03-161-0/+9
| | | | | | | | * sed/compile.c (errors, INCOMPLETE_CMD): New error string. (compile_program): In strict posix mode, complain about incomplete command. * NEWS: Update. Report by Bruno Haible.
* document that . does not match newline in multi-line modePaolo Bonzini2011-11-233-24/+53
| | | | | | | 2011-11-23 Paolo Bonzini <bonzini@gnu.org> * doc/sed-in.texi: Document how multiline mode affects matching newlines against period. Reported by Dmitry Bolshakov.
* fix help text for -iPaolo Bonzini2011-08-292-4/+9
| | | | | | | 2011-08-29 Paolo Bonzini <bonzini@gnu.org> * sed/sed.c (usage): Fix documentation for -i. Reported by Dennis Bartlett.
* avoid silent data loss when an input line is 231 bytes or longerJim Meyering2011-07-252-2/+15
| | | | | | | | | | | | If one line in a file has length (including newline) of 231, then applying sed -i to that file truncates it to size 0. I first noticed it like this: Create a file with line of length 231-1 $ perl -le 'print "v"x(2**31-1)' > k Then prepend a byte to that line: $ sed -i 's/^/v/' k Surprise! The file is empty. * sed/utils.c (ck_getline): Declare "result" to be of type ssize_t, rather than int, to match the return type of getline.
* avoid reopening stdinPádraig Brady2011-07-044-0/+9
| | | | | | | | | | | This adjusts the change made in 3a8e165a, to not reopen stdin on platforms where there is no separate "binary mode". That added some overhead and also precludes the use of tools like `stdbuf -i...`. * execute.c (open_next_file): Only reopen stdin on windos.
* document corner case of \l and \u, and simplify the code handling itPaolo Bonzini2011-05-273-0/+60
| | | | | | | | | | 2011-05-27 Paolo Bonzini <bonzini@gnu.org> * doc/sed-in.texi: Explain behavior of \l and \u at the end of the replacement text. * doc/sed.texi: Regenerate. * sed/execute.c (append_replacement, do_subst): Further simplification.
* fix incorrect comments in the "Increment a number" example.Paolo Bonzini2011-05-273-8/+8
| | | | | | | | 2011-05-27 Paolo Bonzini <bonzini@gnu.org> * doc/sed-in.texi: Fix incorrect comment in the "Increment a number" example. Reported by Wu Liang and Micah Cowan. * doc/sed.texi: Regenerate.
* clang analyzer cleanupsPaolo Bonzini2011-05-274-12/+21
| | | | | | | | 2011-03-11 Paolo Bonzini <bonzini@gnu.org> * sed/compile.c (normalize_text): Clang analyzer cleanup. * sed/execute.c (append_replacement, do_subst): Same. * sed/utils.c (ck_getline): Same.
* fix Makefile.amPaolo Bonzini2011-05-272-4/+6
|
* order command alphabetically in man pageJari Aalto2010-12-135-46/+56
| | | | | | 2010-11-13 Jari Aalto <jari.aalto@cante.net> * doc/sed.x: Order commands alphabetically.
* small fixes to "rename files" examplePaolo Bonzini2010-12-133-1/+9
| | | | | | | 2010-11-10 Paolo Bonzini <bonzini@gnu.org> * doc/sed-in.texi: Fix double negation in comment, escape file names.
* avoid compiler warnings regarding ctype functionsEric Blake2010-11-031-0/+3
| | | | | * basicdefs.h (ISDIGIT): Avoid compiler warning on cygwin. * sed/compile.c (normalize_text): Avoid undefined behavior.
* avoid compiler warningEric Blake2010-11-031-0/+4
| | | | * sed/sed.c (includes): Supply missing header.
* downgrade minimum requested version of gettext to 0.17.Paolo Bonzini2010-11-013-2/+9
| | | | | | | | | 2010-11-01 Paolo Bonzini <bonzini@gnu.org> * autoboot.conf: Replace gettext with gettext-h. Suggested by Gerald Pfeifer and Eric Blake. * configure.ac: Downgrade minimum requested version of gettext to 0.17.
* Commit regenerated doc/sed.texiPaolo Bonzini2010-11-012-4/+7
|
* 2010-10-31 Gerald Pfeifer <gerald@pfeifer.com>Paolo Bonzini2010-10-312-4/+11
| | | | | * doc/sed-in.texi (Extended regexps): Add '|' to the list of differences. Note that "\|" is a GNU extension to begin with.
* fix previous commitPaolo Bonzini2010-10-311-0/+1
|
* fix lseek errors from flushing input pipes on interixPaolo Bonzini2010-10-203-3/+11
| | | | | | | 2010-10-20 Paolo Bonzini <bonzini@gnu.org> * autoboot.conf: Add fwriting. * sed/utils.c: Use it.
* bump minimal gettext versionPaolo Bonzini2010-08-301-1/+1
|
* use version-etc-fsfPaolo Bonzini2010-08-308-37/+90
| | | | | | | | | | | | 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.
* fix typo in the manualPaolo Bonzini2010-08-304-1/+6
| | | | | | 2010-05-03 Timothy Baker <timothypaulbaker@gmail.com> (tiny change) * doc/sed.texi (Regular expressions): Fix typo.
* fix imprecision in the documentation of `D'Paolo Bonzini2010-08-176-17/+31
| | | | | | | | | | | | | | | 2010-08-17 Paolo Bonzini <bonzini@gnu.org> Fix imprecision in the documentation of `D'. * doc/sed-in.texi (D command): Fix documentation of behavior for pattern space ending with \n and with no other newline. Reported by Randall Cotton. * doc/sed.x (D command): Fix documentation of behavior for pattern space ending with \n and with no other newline. * doc/sed.texi: Regenerate. * doc/sed.1: Regenerate. 2010-07-19 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* Let --posix turn off nonportable scripts ending in backslash.Ralf Wildenhues2010-08-172-2/+15
| | | | | | | | * sed/compile.c (errors, INCOMPLETE_CMD): New error string. (compile_program): In strict posix mode, complain about incomplete command. * NEWS: Update. Report by Bruno Haible.
* use mkostemp(template, 0) instead of mkstemp to work around Cygwin oddityPaolo Bonzini2010-08-179-6/+56
| | | | | | | | | | | 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.
* ignore INSTALLPaolo Bonzini2009-12-272-236/+1
|
* add F command.Ralf Wildenhues2009-12-277-22/+54
| | | | | | | | | | | | 2009-11-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> * doc/sed.texi (Extended Commands): Document F command. * doc/sed-in.texi: Regenerate. * sed/compile.c (compile_program): Accept 'F' if not --posix. * sed/execute.c (open_next_file): Always initialize in_file_name. (execute_program): Handle 'F'. * configure.ac: Bump SED_FEATURE_VERSION. * NEWS: Update.
* fix debian bug 559539Paolo Bonzini2009-12-072-1/+6
| | | | | | | 2009-12-07 Clint Adams <schizo@debian.org> (tiny change) * sed/execute.c (open_next_file): If is_selinux_enabled returns -1, treat it as "disabled".
* merge 5156c19b correctlyPaolo Bonzini2009-10-154-12/+17
| | | | | | | 2009-10-15 Paolo Bonzini <bonzini@gnu.org> * sed/execute.c (closedown, open_next_file): Merge 5156c19b correctly. * sed/utils.c: Likewise.
* handle incomplete sequences as if they were invalidPaolo Bonzini2009-10-152-3/+9
| | | | | | | | 2009-10-15 Paolo Bonzini <bonzini@gnu.org> WANG Yunfeng <uhuruh@gmail.com> * sed/execute.c (str_append, str_append_modified): Handle incomplete sequences as if they were invalid.
* more configury simplificationPaolo Bonzini2009-10-142-8/+10
| | | | | | 2009-10-14 Paolo Bonzini <bonzini@gnu.org> * configure.ac: Use cache variables rather than AC_CHECK_FUNC.
* simplify some configuryPaolo Bonzini2009-10-144-25/+10
| | | | | | | | 2009-10-14 Paolo Bonzini <bonzini@gnu.org> * configure.ac: Remove obselete configure tests. * sed/fmt.c: Assume limits.h is always present. * sed/utils.c: Assume vfprintf is always present.
* override LC_ALL in testsuite rather than LANGYury G. Kudryashov2009-10-142-4/+8
| | | | | | 2009-10-14 Yuri G. Kudryashov <urkud.urkud@gmail.com> (tiny change) * testsuite/Makefile.tests: Override LC_ALL, not LANG.