2009-06-27 Paolo Bonzini * configure.ac: Bump version. * NEWS: Bump version. * gnulib: Update. * doc/sed.1: Regenerate. 2009-06-25 Paolo Bonzini * autoboot.conf: Add selinux-h. * execute.c: Copy over file creation context before creating a new file. 2009-06-25 Paolo Bonzini * execute.c: Do not copy ACLs until the file is copied. * utils.c (ck_mkstemp): Set a restrictive umask on temporary files. 2009-06-26 Paolo Bonzini * autoboot: Do not use GIT_CONFIG_LOCAL. 2009-06-15 Paolo Bonzini * autoboot.conf: Add memchr again. * gnulib: Update. 2009-06-11 Sergey Farbotka (tiny change) * sed/execute.c (open_next_file): Fix off-by-one causing problems under Cygwin. 2009-05-11 Paolo Bonzini * sed/compile.c (snarf_char_class): Fix logic bug with [[[ in regular expressions (and a possibly uninitialized use of variable delim stemming from the bug). Uninitialized variable bug reported by Zhongxing Xu. * testsuite/brackets.good: New. * testsuite/brackets.inp: New. * testsuite/brackets.sed: New. * testsuite/Makefile.am: Add test. * testsuite/Makefile.tests: Add test. 2009-05-11 Paolo Bonzini * configure.ac: Define COPYRIGHT_YEAR. * Makefile.am (dist-hook): Test it. * sed/mbcs.c: Fix copyright years. * sed/sed.c: Fix copyright years. Change COPYRIGHT_NOTICE to COPYRIGHT_YEAR. * sed/utils.c: Fix copyright years. * testsuite/version.gin: Use COPYRIGHT_YEAR. 2009-04-30 Paolo Bonzini * sed/compile.c: Declare bool arguments as int instead to please AIX XLC. * sed/execute.c: Declare bool arguments as int instead to please AIX XLC. * sed/utils.c: Declare bool arguments as int instead to please AIX XLC. * sed/utils.h: Declare bool arguments as int instead to please AIX XLC. 2009-04-27 Paolo Bonzini * configure.ac: Bump version number. * configure: Regenerate. 2009-04-27 Paolo Bonzini * configure.ac: Do not create homonymous links from builddir to srcdir. * testsuite/Makefile.tests: Create readin.in2 here. * testsuite/Makefile.am: Do not distribute it. 2009-04-27 Paolo Bonzini * autoboot.conf: Add rename. * gnulib: Update. 2009-04-27 Paolo Bonzini * configure.ac: XFAIL UTF-8 tests where appropriate. 2009-04-27 Paolo Bonzini * testsuite/Makefile.tests: Handle CRLF endings for mingw. 2009-04-27 Paolo Bonzini * configure.ac: Link readin.in2 into builddir. * configure: Regenerate. * doc/Makefile.am: Do not distribute sed.html. Do not update sed.texi if the output does not change. * sed/Makefile.am: Order libraries according to their dependencies. * sed/compile.c (get_openfile): Declare FAIL as int. * sed/sed.c: Avoid printf ("") if REG_PERL is not defined. * testsuite/eval.in2: Do not include in the repository. * testsuite/Makefile.am: Clean always eval.in2 and never readin.in2. * testsuite/Makefile.tests: Provide a default empty definition of TIME and remove rules for readin.in2. 2009-03-31 Paolo Bonzini * bootstrap.sh.in: Add __bool_true_false_are_defined. * bootstrap.sh: Regenerate. * basicdefs.h: Do not provide bool definitions for BOOTSTRAP at all. 2009-03-31 Paolo Bonzini * sed/sed.c (contact): New. (usage): From here. (main): Use it for `sed --version' too. * configure.ac: Point to GNU project mailing lists. * sed/sed.c (contact): Use PACKAGE_BUGREPORT. * testsuite/version.gin: Likewise. * testsuite/version.good: Regenerate. * doc/sed.1: Regenerate. * bootstrap.sh.in (PACKAGE_BUGREPORT): New. * bootstrap.sh: Regenerate. 2009-03-31 Paolo Bonzini * testsuite/Makefile.am: Distribute utf8-3 and utf8-4 test files. 2009-02-17 Paolo Bonzini * testsuite/Makefile.tests: Rewrite rule for utf8-[1234]. Reported by Ralf Wildenhues. 2009-02-17 Paolo Bonzini * sed/sed.c (usage): Print homepage URL. * testsuite/version.gin: Update. 2009-01-28 Paolo Bonzini * sed/sed.c (usage): Only print the bug report address for `sed --help'. (main): Print it for `sed --version' too. * testsuite/version.gin: Adapt. * testsuite/Makefile.tests: Refine help message test. 2009-01-23 Paolo Bonzini Hideo AOKI * sed/compile.c (match_slash): Fix MBCS behavior. * sed/sed.h (MBSINIT): New. 2009-01-20 Paolo Bonzini * autoboot.conf, bootstrap.sh.in: Remove memchr, memcmp, memmove compatibility code. * gnulib: Update. 2009-01-09 Paolo Bonzini * tests/SPENCER.tests: Add testcases for glibc bugzilla 697. * gnulib: Update. 2009-01-05 Paolo Bonzini * execute.c (read_pattern_space): Reset hold space at end-of-file if input->reset_at_next_file. 2008-12-31 Ralf Wildenhues Let --posix turn off more GNU extensions. * sed/compile.c (mark_subst_opts): Turn off subst options i, I, s, S, x, X, m, and M in --posix mode. (compile_address): Disallow address modifiers, `FIRST~STEP', `ADDR1,+N', and `ADDR1,~N' in --posix mode. (compile_program): In --posix mode, do not accept e or z commands; do not accept text between an a, c, or i command and the following backslash; do not accept an argument to the l command. 2008-12-22 Paolo Bonzini * autoboot.conf: Request modules emulating mb functions. * configure.ac: Do not look for mb functions here. 2008-10-03 Paolo Bonzini Jim Meyering * autoboot.conf: Add localcharset. * 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. 2008-10-02 Paolo Bonzini * autoboot: Sync with gnulib's build-aux/bootstrap. 2008-09-29 Paolo Bonzini * autoboot: Sync with gnulib's build-aux/bootstrap. 2008-09-29 Paolo Bonzini * testsuite/Makefile.am: Add the utf8-{1,2,3,4} tests. * testsuite/Makefile.tests: Add the utf8-{1,2,3,4} tests. * testsuite/runtest: Support skipping tests. * testsuite/utf8-1.good: New. * testsuite/utf8-1.inp: New. * testsuite/utf8-1.sed: New. * testsuite/utf8-2.good: New. * testsuite/utf8-2.inp: New. * testsuite/utf8-2.sed: New. * testsuite/utf8-3.good: New. * testsuite/utf8-3.inp: New. * testsuite/utf8-3.sed: New. * testsuite/utf8-4.good: New. * testsuite/utf8-4.inp: New. * testsuite/utf8-4.sed: New. 2008-09-29 Paolo Bonzini * BUGS: Document s/.*.// behavior with invalid multibyte sequences. * NEWS: Document `z' extension. * doc/sed-in.texi: Document both things. * sed/compile.c (compile_program): Recognize `z'. * sed/execute.c (execute_program): Execute `z'. * testsuite/Makefile.am: Add badenc test. * testsuite/Makefile.tests: Add badenc test. * testsuite/badenc.good: New. * testsuite/badenc.inp: New. * testsuite/badenc.sed: New. 2008-09-28 Paolo Bonzini * 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. 2008-08-27 Paolo Bonzini * sed/execute.c (closedown): Close the input file! 2008-08-20 Paolo Bonzini * configure.ac: Add gl_DISABLE_THREADS. 2008-08-20 Ralf Wildenhues * sed/compile.c: Do not include strverscmp.c. 2008-07-21 Paolo Bonzini * doc/sed-in.texi: Remove northpark.edu address for sed FAQ. * doc/sed.texi: Regenerate. 2008-07-10 Paolo Bonzini * doc/sed-in.texi: Make the description of ^ and $ more precise. * doc/sed.texi: Regenerate. 2008-06-04 Vladimir Marek * basicdefs.h: Don't hardcode usage of prototypes on SunStudio. 2008-05-15 Paolo Bonzini * autoboot.conf: Update for newer gnulib. 2008-05-15 Paolo Bonzini * bootstrap.sh.in: Define bool, true, false. Reported by Jason Stover. Adjust for gnulib changes. * bootstrap.sh: Regenerate. 2008-04-24 Paul Eggert * sed/compile.c (match_slash): Treat 's&foo&\&&' compatibly with traditional 'sed'. * testsuite/bsd.sh: Add test case for this. * testsuite/bsd.good: Add test case output. 2008-04-24 Paolo Bonzini * sed/compile.c (setup_replacement): Fix bug with \& in POSIX mode. 2008-01-16 Jim Meyering * sed/execute.c (open_next_file, get_backup_file_name): Avoid warnings from gcc. 2008-01-16 Jim Meyering * sed/compile.c (snarf_char_class): Reverse order of conjuncts so that "delim" is not used uninitialized. 2008-01-16 Jim Meyering * sed/utils.c (panic): Remove declaration of unused local, "fd". 2008-01-16 Jim Meyering * sed/execute.c (open_next_file, get_backup_file_name): Avoid warnings from gcc. Avoid shadowing global "pipe". 2008-01-16 Jim Meyering * autoboot.conf (gnulib_modules): Add stat-macros and pathmax. 2007-10-25 Paolo Bonzini Mike Frysinger * doc/sed.x (q, Q): Document argument. * configure.ac: Remove texi2html checks. * doc/Makefile.am: Remove rules for sed.html, always distribute it. 2007-08-14 Paolo Bonzini * sed/execute.c (open_next_file): Follow symlink here... (closedown): ... not here. 2007-06-29 Paolo Bonzini * sed/mbcs.c: Upgrade to GPLv3. * sed/regexp.c: Upgrade to GPLv3. * sed/sed.c: Upgrade to GPLv3. * sed/sed.h: Upgrade to GPLv3. * sed/utils.c: Upgrade to GPLv3. * sed/utils.h: Upgrade to GPLv3. * sed/compile.c: Upgrade to GPLv3. * sed/execute.c: Upgrade to GPLv3. * sed/fmt.c: Upgrade to GPLv3. 2007-03-01 Masatake YAMATO (tiny change) * sed/compile.c (compile_program): Accept 0,/REGEXP/ address specification only if --posix is not specified. 2007-02-05 Paolo Bonzini * testsuite/bug-regex27.c, testsuite/bug-regex28.c: New, from glibc (written by Jakub Jelinek). 2007-01-26 Paolo Bonzini * sed/compile.c (check_final_program): Don't set text if the pending_text is initialized but empty. * sed/execute.c (output_line): Don't print text if it is NULL. * testsuite/Makefile.am (TESTS): Add insert. * testsuite/Makefile.tests (insert): New. * testsuite/insert.good, testsuite/insert.sed, testsuite/insert.inp: New testcase from Jonas Koelker. 2006-12-29 Paolo Bonzini * sed/compile.c: Fix warnings. * sed/execute.c: Fix warnings. 2006-12-22 Bruno Haible * sed/utils.c: Include pathmax. * sed/mbcs.c: Use local_charset. * sed/execute.c: Copy with padding after the mbstate_t member. 2006-12-21 Paolo Bonzini * sed/mbcs.c: Include string.h (reported by Henning Nielsen Lund). * sed/fmt.c: Likewise. * sed/regexp.c: Likewise. 2006-12-18 Paolo Bonzini * sed/execute.c (closedown): Remove dead code. 2006-12-17 Paolo Bonzini * sed/utils.c: Include limits.h. 2006-12-16 Paolo Bonzini * doc/sed-in.texi: Document --follow-symlinks. 2006-12-15 Paolo Bonzini * sed/regexp.c: Disable all extensions on --posix. 2006-09-24 Paolo Bonzini * sed/execute.c: Support ACLs. * lib/utils.c: Move... * sed/utils.c: ... here, and remove xmalloc. 2006-08-21 Paolo Bonzini * sed/regexp.c: Accept NUL bytes for `.'. Accept 'a\(b' in POSIXLY_CORRECT/POSIXLY_BASIC posixicity. 2006-08-03 Paolo Bonzini Revert this part of the previous change: 2006-08-03 Paolo Bonzini * sed/compile.c (get_openfile): Change second argument to char and turn it into a string within the function. Adjust callers. 2006-08-03 Paolo Bonzini Corinna Vinschen * 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. 2006-08-03 Paolo Bonzini * sed/execute.c (str_append): Use is_utf8 to skip useless work. * sed/mbcs.c (initialize_mbcs): Look for a UTF-8 locale. (is_utf8): New. * sed/sed.h (is_utf8): New. 2006-07-13 Paolo Bonzini * bootstrap.sh.in: Add a few autoconfy tests. * Makefile.am: Update distributed bootstrap.sh. 2006-05-15 Hans-Bernhard Broeker * sed/basicdefs.h (OB_MALLOC): Turn VCAST into void * cast. 2006-02-03 Paolo Bonzini * sed/compile.c (compile_program) : Pass false to match_slash. 2005-09-07 Paolo Bonzini * 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. 2005-08-30 Paolo Bonzini * sed/execute.c (reset_addresses): Never activate ADDR_IS_NUM_MOD addresses. * testsuite/modulo.good, testsuite/modulo.inp, testsuite/modulo.sed: New. * testsuite/Makefile.tests: Add new testcase. * testsuite/Makefile.am: Add new testcase. * testsuite/Makefile.in: Regenerate. 2005-05-18 Maciej W. Rozycki * configure.ac: Use a cache variable for the libcP test. * configure: Regenerate. 2005-05-16 Eero Hakkinen * sed/compile.c (snarf_char_class): Fix handling of [^]xyz]. 2005-04-04 Paolo Bonzini * sed/execute.c (process_files): Do not add a default command-line in in-place editing mode. 2005-02-10 Paolo Bonzini * testsuite/Makefile.tests: Add new testcase. * testsuite/Makefile.am: Add new testcase. * testsuite/Makefile.in: Regenerate. * testsuite/appquit.good, testsuite/appquit.inp, testsuite/appquit.sed: New testcase. * testsuite/readin.sed: Quit after the last r command. * testsuite/readin.good: Adjust. * sed/execute.c (execute_program): Dump the results of the a/r/R commands just before quitting. 2005-02-10 Paolo Bonzini * sed/regexp.c: Fix off-by-one error in the "invalid reference to subexpression" message. Debian bug 294339. 2005-02-08 Paolo Bonzini * lib/obstack.h: include config.h. 2005-02-01 Paolo Bonzini * doc/Makefile.am: Don't enable MAKEINFO_HTML and TEXI2HTML_HTML rules unless BUILD_HTML. 2005-01-25 Paolo Bonzini * sed/regexp.c: Fix building on GCC 2.95 and earlier. 2004-12-26 Paolo Bonzini Do not use leftmost-longest matching for addresses. * NEWS: Add a note about this. * testsuite/recall2.good, testsuite/recall2.inp, testsuite/recall2.sed: New test. * testsuite/Makefile.am, testsuite/Makefile.tests: Add the recall2 test. * sed/sed.h (struct regex): New. (struct addr, struct subst, compile_regex, match_regex, release_regex): Use it instead of regex_t. * sed/compile.c (compile_program): Update for new meaning of the third parameter of compile_regex. * sed/execute.c (do_subst): Pass less conservative value to the regsize parameter of match_regex. * sed/regexp.c (compile_regex_1): New, extracted out of compile_regex. The third parameter, needed_sub, now includes \0 (so 10 means that \0 .. \9 are needed). Pass RE_NO_SUB if needed_sub is zero. (compile_regex): Accept a struct regex instead of a regex_t. Save the regular expression's text. (match_regex): Accept a struct regex instead of a regex_t. Recompile the pattern if it was compiled with RE_NO_SUB. (release_regex): Accept a struct regex instead of a regex_t. * doc/Makefile.am: Generate sed.texi correctly when building outside srcdir. 2004-12-26 Paolo Bonzini * BUGS: Add section about [a-z] matching uppercase characters, and other locale issues. * doc/sed-in.texi [!PERL]: Likewise. 2004-11-15 Paolo Bonzini * sed/execute.c (str_append_modified): Copy the first character when using \l or \u in a multi-byte configuration. Use WCRTOMB instead of wcrtomb. * sed/sed.h (WCRTOMB): New. 2004-11-11 Paolo Bonzini * tst-rxspecer.c: Do not mix instructions and declarations. * basicdefs.h: Include locale.h before #defining gettext, to avoid breakage under Solaris. * sed/sed.c: do not include locale.h. 2004-11-03 Paolo Bonzini * bug-regex11.c: Improve portability. * bug-regex12.c: Improve portability. * bug-regex13.c: Improve portability. * bug-regex14.c: Improve portability. * bug-regex21.c: Improve portability. * bug-regex9.c: Improve portability. * tst-boost.c: Improve portability. * tst-pcre.c: Improve portability. * tst-regex.c: Improve portability. * tst-rxspencer.c: Improve portability. 2004-10-08 Paolo Bonzini * lib/utils.c (utils_id_s): Renamed to open_files. (struct id): Renamed to struct open_file. 2004-10-08 Jakub Jelinek * testsuite/Makefile.tests (bug-regex*, run-tests, run-ptests): Use $(SED). (version): Likewise; prepend $(SED) invocation with $(SEDENV). 2004-08-16 Paolo Bonzini *** Version 4.1.2 released. 2004-08-06 Paolo Bonzini * sed/compile.c (bad_command): Fix off-by-one error. (snarf_char_class): Fix problem with [.....[] (i.e. last char in class is a bracket. 2004-06-30 Paolo Bonzini *** Version 4.1.1 released. 2004-06-29 Paolo Bonzini * sed/compile.c (mark_subst_opts): Return int. * sed/execute.c (open_next_file): Fix uninitialized variable. 2004-06-10 Paolo Bonzini *** Version 4.1 released. 2004-03-25 Paolo Bonzini * lib/obstack.h: Get current version. 2004-03-13 Paolo Bonzini Exit as soon as possible on an I/O error, and with a better error message. * lib/utils.c (ck_mkstemp, ck_rename, ck_getline): New functions. Save temporary files into utils_id_s. (struct id): Add a field named temp. (ck_fopen): Init the new temp field of struct id. (panic): Unlink temporary files before exiting. * sed/execute.c (read_file_line): Use ck_getline. (closedown): Use ck_rename. (open_next_file): Use ck_mkstemp. 2004-01-20 Paolo Bonzini * sed/sed.h (enum addr_state): New definition. (enum addr_type): Remove ADDR_IS_NUM2. (struct sed_cmd): Replace a1_matched with range_state. * sed/compile.c (next_cmd_entry): Use range_state. (compile_program): Death to ADDR_IS_NUM2. Compile N,Mp as Np if N>=M. * sed/execute.c (match_address_p): Rewritten. Handle ADDR_IS_NUM here. (match_an_address_p): Suit to new match_address_p. (execute_program): Adjust to use range_state in `c'. Handle addr_bang here. (reset_addresses): Use range_state. (struct input): New field "reset_at_next_file". (read_pattern_space): Use it instead of "separate_files". (process_files): Initialize it. 2004-01-17 Paolo Bonzini * sed/sed.h: Do not include wchar.h and wctype.h, and do not include the alloca stuff. * basicdefs.h: Move all that here. 2004-01-15 Paolo Bonzini * sed/regexp.c [REG_PERL]: Use REG_STARTEND instead of regexec2. 2004-01-09 Paul Eggert Paolo Bonzini * sed/sed.h (posixicity): New variable, replaces POSIXLY_CORRECT. * sed/sed.c (main): Set it. * sed/compile.c: Use it instead of POSIXLY_CORRECT. * sed/execute.c: Use it instead of POSIXLY_CORRECT. * doc/sed-in.texi: Document it and --posix. 2004-01-05 Paul Eggert Paolo Bonzini * NEWS: Fix [\n] to match either backslash or n in POSIXLY_CORRECT mode. * doc/sed-in.texi: Document this. Also, document regular expressions a bit better overall, using terminology that's more similar to POSIX. * sed/sed.h (enum text_types): New definition. * sed/compile.c (normalize_text): Replace final parameter with one of type normalize_text. If TEXT_REGEX and in POSIXLY_CORRECT mode, grok character classes without replacing \n inside them. 2004-01-03 Paolo Bonzini * sed/execute.c (execute_program): print final line after executing N, if not POSIXLY_CORRECT. 2003-12-28 Paolo Bonzini * sed/compile.c: fix "\\\n" in RHS of s command. Reported by Mike Castle. * testsuite/bkslashes.inp, testsuite/bkslashes.good, testsuite/bkslashes.sed: New files. * testsuite/Makefile.am, testsuite/Makefile.tests: Add the bkslashes test. 2003-12-16 Paolo Bonzini *** Version 4.0b released. * sed/mbcs.c: New file. * sed/sed.h: Declare macros for mbcs.c. * sed/compile.c: Use them. (brlen): Moved to mbcs.c. * sed/execute.c: Use them. * sed/sed.c: call initialize_mbcs (). 2003-12-14 Paolo Bonzini * sed/regex.c (match_regex): fix memory leak. 2003-11-27 Paolo Bonzini * sed/execute.c (reset_addresses): leave addresses 0 and 0~STEP enabled. 2003-11-15 Jakub Jelinek * sed/regex.c: Use fastmap. 2003-09-21 Paolo Bonzini *** Version 4.0a released. * sed/execute.c (struct line): Add mbstate field. (str_append): Keep mbstate up to date. (str_append_modified): Likewise, and use towupper/towlower. (line_init): Initialize mbstate. (line_copy): Copy mbstate. (line_append): Copy mbstate. 2003-07-15 Stepan Kasal Paolo Bonzini Change the way we treat lines which are not terminated by a newline. Such lines are printed without the terminating newline (as before) but as soon as more text is sent to the same output stream, the missing newline is printed, so that the two lines don't concatenate. * sed/execute.c (output_file): Is now struct output; users adjusted to access the fp field, call output_missing_newline before, and call flush_output afterwards. (read_file_line): Set line.chomped FALSE each time we encounter a line without the newline terminator, no matter whether this is the last input file or not, and no matter whether we are in POSIXLY_CORRECT mode or not. (output_missing_newline): New function which prints the suppressed newline, if necessary. (flush_output): New function for a common pattern. (output_line): Use struct output, set its flag accordingly. (dump_append_queue): Use `ck_fwrite' instead of output_line. (do_list): Flush the output stream at the end. (closedown): The code ``if(separate_files) rewind_read_files();'' (read_pattern_space): ... has been moved here. (process_files): Don't do the default `p' at the end, ... (execute_program): ... as this function is now responsible for it; add the code to the end of the function and to the command `q'; the commands `d', `D' and `Q' thus no longer have to forge an empty line. (execute_program): Commands `c' and `i' no longer call the function output_line with chomped==FALSE; instead, they chomp the text and call the function with chomped==TRUE. (execute_program): Command `e' no longer uses output_line; it calls ck_fwrite directly. Commands `e', `L' and `=' flush the output stream at the end. * sed/compile.c (special_files): Use `struct output' instead of the file name. (get_openfile): ... special files are no longer copied to file_read or file_write. (fp_list): Move to sed.h (users adjusted) and rename as... * sed/sed.h (struct output): ...this. New flag missing_newline associated to the output stream. (struct sed_cmd, struct subst): Use `struct output *' instead of mere `FILE *'; adjust compile.c and execute.c. * testsuite/noeolw.sed, testsuite/noeolw.good, testsuite/noeolw.1good, testsuite/noeolw.2good: New tests 2003-07-15 Stepan Kasal * lib/utils.h, sed/sed.h: #include "basicdefs.h", don't include it from various *.c files. * sed/regex.c: Don't include regex.h as it's included via sed.h. 2003-06-11 Paolo Bonzini * lib/getline.c: Don't realloc with first param = NULL. 2003-05-07 Paolo Bonzini * sed/execute.c: Make treatment of ADDR_IS_NUM_MOD simpler, and fix bugs in 0~5,+1 * sed/compile.c: Complain about addresses like 0 and 0,3 which are sources of misunderstandings. Reported by Akim Demaille 2003-03-25 Paolo Bonzini *** Version 4.0.7 released * sed/execute.c (append_replacement): Extract from do_subst (do_subst): Don't update count when a match was skipped. * testsuite/xbxcx3.good, testsuite/xbxcx3.sed, testsuite/xbxcx3.inp: Regression tests 2003-03-23 Paolo Bonzini * sed/execute.c (do_subst): Fix several bugs with numbered matches * testsuite/numsub2.good, testsuite/numsub2.inp, testsuite/numsub2.sed, testsuite/numsub3.good, testsuite/numsub3.inp, testsuite/numsub3.sed, testsuite/numsub4.good, testsuite/numsub4.inp, testsuite/numsub4.sed, testsuite/numsub5.good, testsuite/numsub5.inp, testsuite/numsub5.sed: regression tests for the bugs 2003-03-15 Paolo Bonzini *** Version 4.0.6 released * lib/mkstemp.c: Include sys/file.h if available for the benefit of Ultrix 2003-03-14 Paolo Bonzini * sed/compile.c: Replace flagT with bool * sed/execute.c: Replace flagT with bool * sed/fmt.c: Replace flagT with bool * sed/sed.c: Replace flagT with bool * sed/regex.c: Replace flagT with bool 2003-03-13 Paolo Bonzini * sed/compile.c (compile_program): Understand parameter of `v'. * sed/sed.c (usage): Split help message into multiple strings (main): Don't understand -h and -V 2003-03-12 Paolo Bonzini * sed/compile.c (match_slash, snarf_char_class): More multibyte character support (brlen): New function * testsuite/classes.good, testsuite/classes.inp, testsuite/classes.sed: New files 2003-03-10 Paolo Bonzini * sed/compile.c (match_slash): Strip the \ in front of slashes (so that the matcher sees x/ for s/x\///). Don't match / and [ unless at the start of a character. 2003-02-18 Paolo Bonzini * sed/regex.c (compile_regex): // matches the last regular expression even in POSIXLY_CORRECT mode. * sed/compile.c (normalize_text): Treat multibyte character sets correctly (read_text): Don't swallow backslash sequences, run text through normalize_text (compile_program): Ditto for y command * sed/compile.c (normalize_text): Add parameter that says whether the text will be processed further to remove more backslash escapes. Callers adjusted (match_slash): Remove same parameter from here. Callers adjusted. 2003-02-15 Paolo Bonzini * sed/sed.h: Fix prototype for match_regex, declare re_registers if REG_PERL * sed/execute.c (do_subst): Use re_registers * sed/regex.c (copy_regs): New function [REG_PERL]: Use re_registers [!REG_PERL]: Avoid using internal entry points, support pre-glibc 2.3 regex for the sake of --without-included-regex. 2003-01-04 Paolo Bonzini * sed/sed.h: Move some stuff from here... * sed/basicdefs.h: ...to here * lib/utils.c (ck_fopen): Add FAIL parameter * lib/utils.h: Adjust parameter * sed/compile.c, sed/execute.c, sed/sed.c: Adjust callers * sed/basicdefs.h: Add TRUE/FALSE * sed/compile.c, sed/execute.c, sed/sed.c: Use them * sed/fmt.c: Do not redefine them 2003-01-02 Paolo Bonzini * sed/sed.c: Bump copyright year 2002-12-24 Paolo Bonzini * sed/sed.c: Use bindtextdomain * sed/basicdefs.h [__EMX__]: Define initialize_main * lib/getline.c [__EMX__]: Strip trailing CR * sed/regex.c: Don't use N_ on the lines that define error messages, some compilers complain. 2002-12-18 Paolo Bonzini *** Version 4.0.5 released * sed/compile.c: Don't use N_ on the lines that define error messages, some compilers complain. 2002-12-16 Paolo Bonzini * sed/compile.c: Improvements to some error messages; `a', `i', `l', `L', `r' accept two addresses except in POSIXLY_CORRECT mode. 2002-12-14 Paolo Bonzini * lib/regex_internal.c: Fix problem on non-glibc systems, from Jakub Jelinek * lib/regex.c (RE_ENABLE_I18N): Conditionalize on HAVE_MBRTOWC and HAVE_WCRTOMB. * lib/getline.c: Fix compilation on non-glibc system * lib/snprintf.c: Fix compilation on non-glibc system * lib/basicdefs.h [P_]: Make more portable 2002-12-12 Paolo Bonzini *** Version 4.0.4 released 2002-11-21 Paolo Bonzini *** Version 4.0.3 released 2002-11-19 Paolo Bonzini *** Version 4.0.2 released 2002-11-05 Paolo Bonzini *** Version 4.0.1 released 2002-10-23 Paolo Bonzini *** Version 4.0 released 2002-10-28 Paolo Bonzini * lib/utils.c: Don't fail for EBADF in fflush * src/sed.c: the_program is now a global 2002-10-19 Paolo Bonzini * src/sed.c: Print GNU sed in --version for GNU sed, and super-sed for super-sed (thanks to Bruno Haible) 2002-10-17 Paolo Bonzini *** Version 3.96 released 2002-10-16 Isamu Hasegawa * src/execute.c (execute_program): Multibyte 'y' * src/compile.c (compile_program): Likewise * src/sed.h: Likewise 2002-10-08 Paolo Bonzini *** Version 3.95 released 2002-07-15 Paolo Bonzini * src/sed.h: rfile --> fname, wfile --> fp * src/compile.c (compile_command): Parse 'R' like 'w', use separate lists for file read and file write * src/compile.c (get_openfile): New name of get_writefile * src/compile.c (rewind_read_files): New function * src/sed.h: Declared here * src/execute.c (closedown): And called here * src/execute.c (append_queue): Added 'free' field * src/execute.c (execute_program): Implement 'R' 2002-06-09 Paolo Bonzini * src/execute.c (do_subst): Replaced flag was set on every regexp match, while the first matches should not set it for s///N. 2002-06-08 Paolo Bonzini * src/compile.c (compile_file): Open the script in text mode * lib/utils.c (utils_fp_name): Shorten the output * lib/utils.c (ck_fread, ck_fwrite, ck_fflush): Clearerr after printing an error. * lib/utils.c (ck_fclose): Work on stdout as well if stream == NULL and flush before closing to check for errors 2002-05-30 Paolo Bonzini * src/compile.c (compile_program): Implement W * src/execute.c (execute_program): Likewise 2002-04-23 Paolo Bonzini * src/sed.c (usage, main): Parse -s * src/sed.h (separate_files): New variable * src/execute.c (separate_files): New variable * src/execute.c (reset_addresses): New function to make range addresses work separately on each file when using in-place editing * src/execute.c (execute_program): The `n' and `N' use test_eof so that the script restarts at end of file, not at end of input * src/execute.c (test_dollar_EOF): Make $ work separately on each file when using -s; renamed to test_eof 2002-02-28 Paolo Bonzini * src/sed.h (struct sed_cmd): exit_status -> int_arg * src/compile.c: Likewise * src/execute.c: Likewise * src/compile.c (compile_command): Parse `l' like `q' and `Q'; default for int_arg is -1 * src/execute.c (do_list): New argument, used instead of lcmd_out_line_len (execute_program): Interpret int_arg for the `l' command; return 0 for `q' and `Q' if int_arg is -1 * src/fmt.c: New file, looted from GNU textutils * src/compile.c: Parse `L' * src/execute.c: Execute `L' 2002-02-14 Paolo Bonzini * src/execute.c (str_append_modified): Fixed a stupid bug (stop condition was *start == *end, meant to be start == end) 2002-02-05 Paolo Bonzini * lib/utils.c: Added directory parameter to temp_file_template * lib/utils.h: Adjusted * src/execute.c: Adjusted 2002-01-29 Paolo Bonzini * src/compile.c (mark_subst_opts): Signal an error if there are multiple g or p options * src/compile.c (compile_program): Raise appropriate error if second string in y command is longer than first (used to be "excess junk after command") 2001-12-31 Paolo Bonzini * lib/getline.c: Strip the terminating \r under Windows or MS-DOS. * testsuite/xemacs.sed, testsuite/xemacs.inp, testsuite/xemacs.good: Submitted by John Fremlin (john@fremlin.de) 2001-12-27 Paolo Bonzini * sed/execute.c (do_subst): Flags in optimized s/^xx/ commands were discarded (see the change below) 2001-12-19 Paolo Bonzini * sed/execute.c (resize_line): Limit inactive space to two thirds of a buffer * sed/execute.c (line_init): Initialize buf->active * sed/execute.c (str_append, str_append_modified, line_copy, do_list, do_subst, execute_program, process_files): Operate on active space * sed/execute.c (do_subst): Optimize s/^xx// by making a part of the buffer inactive and s/xx$// by truncating it. * sed/execute.c (execute_program): Optimize D by making a part of the buffer inactive * testsuite/uniq.sed, testsuite/uniq.inp, testsuite/uniq.good: added to test P and D commands. * testsuite/fasts.sed, testsuite/fasts.inp, testsuite/fasts.good: added to test the new optimization done on the `s' command. 2001-12-17 Paolo Bonzini * testsuite/dc.inp: Also compute Easter of 2002 :-) * sed/execute.c [!HAVE_FCHMOD]: Don't chmod the output file if working in-place 2001-11-12 Paolo Bonzini * sed/sed.h (struct sed_cmd): a1 is a pointer too * sed/compile.c: Likewise * sed/execute.c: Likewise * sed/compile.c: Use obstacks * sed/execute.c: Likewise 2001-11-09 Paolo Bonzini * sed/compile.c (mark_subst_opts): Parse option `e', preserve two occurrences of the `e' and `p' options. * sed/execute.c (do_subst) [HAVE_POPEN]: Interpret option `e' (evaluate, like Perl's but uses Bourne shell). * sed/sed.h (struct subst): Add an `eval' flag. * sed/compile.c (compile_program): Compile command `e' like `c'. * sed/execute.c (execute_program): Execute command `e'. 2001-09-25 Paolo Bonzini * sed/compile.c (get_writefile) [!POSIXLY_CORRECT]: support /dev/stdout * sed/execute.c (open_next_file, closedown): Support in-place editing * sed/execute.c (backup_file_name): New function to support in-place editing * sed/main.c (usage, main): Parse -i. * sed/utils.c: Moved to lib directory * lib/utils.c (temp_file_template): New function. * sed/utils.h: Declared temp_file_template. 2001-09-05 Paolo Bonzini * sed/execute.c (do_subst): `baaac', if passed through s/a*/x/g, gave `xbxxcx' rather than `xbxcx' (because an empty string matched before the `c'. Fixed. * sed/execute.c: Removed mmap support, I/O is done using getline (slower but more bug-proof). * sed/utils.c: Likewise. * lib/getline.c: New file 2001-03-22 Paolo Bonzini * sed/compile.c (normalize_text) [POSIXLY_CORRECT]: Enable escapes in modes other than BRE. 2001-03-21 Paolo Bonzini * sed/compile.c (normalize_text): Support \XXX in Perl mode, \oXXX in non-Perl mode. 2001-03-18 Paolo Bonzini * sed/compile.c (compile_program): Fixed missing break when compiling 'q' and 'Q'. * sed/compile.c (check_final_program): Removed now spurious call to compile_regex * sed/regex.c (compile_regex): Don't track the last compiled regex * sed/regex.c (execute_regex): Track here the last compiled regex 2001-03-02 Paolo Bonzini * sed/compile.c (setup_replacement): Support \[lLuUE] like Perl and vi. * sed/compile.c (new_replacement): Accept new parameter to support \[lLUuE]. * sed/sed.h (enum replacement_types): New declaration * sed/execute.c (do_subst): Use new function str_append_modified to apply the changes required via \[lLUuE]. * sed/execute.c (str_append_modified): New function 2001-03-02 Paolo Bonzini * sed/compile.c (setup_replacement): Count the number of backreferences that the RHS needs * sed/regex.c (compile_regex): Check if there is a sufficient number of backreferences (new argument needed_sub replaces nosub) * sed/compile.c (compile_address, compile_program, check_final_program): Callers adjusted 2001-02-08 Paolo Bonzini * sed/compile.c (compile_program): Added `Q' (quit without output) * sed/execute.c (execute_program): Ditto * sed/compile.c (compile_program): Fill in exit_status for `q' and `Q' * sed/execute.c (execute_program): Return -1 for `go on', 0..255 to set the exit status * sed/execute.c (process_files): Interpret new convention for execute_program, return sed's exit code * sed/sed.c (main): Return process_files's exit code * sed/sed.h (struct sed_cmd): Declare exit_status 2001-01-07 Paolo Bonzini * sed/compile.c (compile_program): Added `T' (branch if failed) * sed/execute.c (shrink_program, execute_program): Ditto 2001-01-04 Paolo Bonzini * testsuite/Makefile.am: Use automake's implementation of `make check'. Removed the test targets * testsuite/Makefile.tests: Moved the test targets here (new file). * testsuite/runtest: New file * testsuite/Makefile.tests: `khadafy' test uses EREs. * testsuite/spencer.inp: Removed the ^* test * testsuite/spencer.sh: Don't rely on awk; more comments too 2001-01-03 Paolo Bonzini * sed/compile.c(snarf_char_class) [REG_PERL]: Don't parse `\n' specially * sed/compile.c(match_slash) [REG_PERL]: Ditto * sed/compile.c(read_text) [REG_PERL]: Support [xX] modifiers * sed/compile.c(mark_subst_opts) [REG_PERL]: Ditto 2000-12-21 Paolo Bonzini * lib/snprintf.c [BOOTSTRAP]: Don't include stdio.h * lib/strerror.c [BOOTSTRAP]: Don't include stdio.h * sed/execute.c [!HAVE_ISATTY]: Don't buffer stdin 2000-12-11 Paolo Bonzini * sed/compile.c(mark_subst_opts): Support [mMsS] flags * sed/compile.c(read_text): Support [MS] flags for addresses * sed/regex.c(compile_regex): Support arbitrary flags for regncomp. * sed/regex.c(compile_regex) [REG_PERL]: Don't call normalize_text. 2000-12-08 Paolo Bonzini * basicdefs.h: Moved here from the `sed' subdirectory. * configure.in: Removed crap to pick a regex engine. Added snprintf to the AC_REPLACE_FUNCS call. * lib/snprintf.c: New file. * sed/regex.c(compile_regex): Use regncomp * sed/regex.c(match_regex): Use regexec2 * sed/compile.c(compile_program): Implemented the `v' command. * sed/sed.c(main): Implemented the `r' and `R' options * sed/sed.h: Replaced use_extended_syntax_t with extended_regexp_flags to support Perl regular expressions. * sed/execute.c(open_next_file): Don't mmap stdin (because we cannot seek into it, so a redirected stdin's contents would not be "eaten" by sed) Mon Aug 30 23:40:08 PDT 1999 Ken Pizzini *** Version 3.02.80 released * sed/execute.c(do_subst): lib/regex.c(re_search_2) seems to want one extra backreference register; humor it. * sed/regex.c(compile_regex): work around some odd assumptions that lib/regex.c(re_compile_pattern) makes about our desired RE syntax. * configure.in: tweaked version to 3.02.80; added new entries to the ALL_LINGUAS definition. * doc/sed.1, doc/sed.texi, BUGS: explicitly request the output of sed --version in bug-reporting instructions. * doc/sed.texi: the old "informal seders list" is dead; document the new sed-users mailing list instead (under Other Resources). Thu Aug 19 23:27:54 PDT 1999 Ken Pizzini * sed/sed.h: Add explicit #include of "regex-sed.h" (rather than relying on parent file doing so); change the "cmd_regex" member of sed_cmd: make it a pointer (instead of a struct), and change its name to cmd_subst; add prototypes for newly exported functions bad_prog(), normalize_text(), compile_regex(), match_regex(), and release_regex(); drop rx_testing variable. * sed/compile.c: move the compile_regex() function to regex.c; export bad_prog() and normalize_text() functions; eliminate the rx_testing debris; rename the NOLEAKS symbol to more descriptive DEBUG_LEAKS; make cmd_regex to cmd_subst fixes (see above); make use of newly abstracted release_regex() function. * sed/execute.c: abstract out the regex matching to regex.c:match_regex(); NOLEAKS to DEBUG_LEAKS change; cmd_regex to cmd_subst structure member name change. * sed/execute.c(do_subst): use re_registers/regoff_t instead of regmatch_t to hold the backreference registers, make "offset" always be relative to the beginning of the string (rather than a delta from "start"), defer some matching bookkeeping (e.g., not_bol_p) to match_regex(). * sed/sed.c(main): loose rx_testing variable; NOLEAKS (aka DEBUG_LEAKS) code attempting to release _nl_current_default_domain is problematic, so omit it. * sed/regex.c: new file --- abstracts out the interface to the regex engine so that less conditional code is required in compile.c and execute.c, and so as to make a change of engine easier; implements compile_regex() (which looks an awful lot like the one that used to live in compile.c), match_regex(), and (if DEBUG_LEAKS is set) release_regex(). Sun Apr 18 04:40:46 PDT 1999 Ken Pizzini * sed/sed.c(main): conditionalize calls to setlocale() and textdomain() to only occur if their support is needed/wanted. Sun Apr 18 03:01:46 PDT 1999 Ken Pizzini * bootstrap.sh: "foo || bar && baz" was not grouping like I expected ("foo || (bar && baz)") under at least one shell, so change the test for a pre-existing config.h file to an if statement. * bootstrap.sh: added -DUSE_REGEX_GNU_H option to the compiler invocation, to ensure that we get a usable regex library included. Sun Apr 18 02:59:42 PDT 1999 Ken Pizzini * sed/sed.h, sed/utils.c: conditionalized inclusion of to occur only if ENABLE_NLS is defined. Sun Apr 18 01:48:45 PDT 1999 Ken Pizzini * sed/compile.c(xofa,normalize_text,convert_number): change name of xofa() function to convert_number(); change semantics to do all of the work of the text->number conversion. * sed/compile.c(normalize_text): add new \dDDD decimal and \oOOO octal escapes. Sun Mar 28 21:05:07 PST 1999 Ken Pizzini * sed/sed.c(main): if NOLEAKS is set, free up a word that the call to textdomain() allocated. * sed/execute.c(read_file_line): plug up (minor) memory leak: if buffer.alloc==0 we may have malloc()'d 1 byte anyway, so be sure to FREE(buffer.text) before calling line_init(); Fri Mar 26 16:52:10 PST 1999 Ken Pizzini * sed/compile.c(match_slash): somewhere between 3.02 and 3.02a we lost the ability to use a newline as the s/// delimiter; restore this ability. * sed/compile.c(compile_regex): forget about trying to cache the compiled form of the last RE --- it causes more problems than its worth. We now only cache the source form. * testsuite/help.good: update to reflect output containing new options. Sun Dec 6 00:51:23 PST 1998 Ken Pizzini * sed/utils.c(ck_fwrite): fix i18n bug of using a printf fragment of "item%s" to handle plural text. Mon Nov 23 11:03:40 PST 1998 Ken Pizzini * doc/sed.1, doc/sed.texi: ran ispell over these files to catch the more obvious typos... Sun Nov 1 00:09:07 PST 1998 Ken Pizzini * sed/execute.c(do_list): make a `lcmd_out_line_len' (--line-length) of zero mean "infinite length", i.e., "never wrap". Sat Oct 31 23:06:50 PST 1998 Ken Pizzini * execute.c(match_an_address_p,process_files), compile.c(compile_program): back out the "zero-address" changes of 1998-09-27. It was a neat idea, but there are too many dark corners which don't work well. The special code for handling line ranges starting at address zero (from 1998-08-31) are still there though: this seems to work fine with no surprises. Sat Oct 31 22:18:59 PST 1998 Ken Pizzini * sed/sed.c, sed/sed.h, sed/execute.c: added new `lcmd_out_line_len' variable. (Idea suggested by Carlos J. G. Duarte .) Also added ATOI macro (which uses strtoul() if available, with fall-back to atoi()). * sed/sed.c(main): attempt to use COLS environment variable to set a reasonable `lcmd_out_line_len'; added -l/--line-length command-line options to set the new `lcmd_out_line_len' flag. * sed/sed.c(usage): documented new -l/--line-length options. * sed/execute.c(do_list): use `lcmd_out_line_len' variable instead of `LCMD_OUT_LINE_LEN'. * sed/execute.c: deleted now obsolete LCMD_OUT_LINE_LEN define. * configure.in: added strtoul to the AC_CHECK_FUNCS call. Sat Oct 31 21:37:17 PST 1998 Ken Pizzini * sed/sed.c, sed/sed.h, sed/execute.c: added new `force_unbuffered' flag. (Idea suggested by Frank Strauss .) * sed/sed.c(main): added -u/--unbuffered command-line options to set the new `force_unbuffered' flag. * sed/sed.c(usage): documented new -u/--unbuffered options. * sed/execute.c: changed the name of the `is_tty' flag in struct input to a more generic `no_buffering'; also removed HAVE_ISATTY conditional on this member. * sed/execute.c(slow_getline): removed HAVE_ISATTY conditonal compilation of this function. * sed/execute.c(output_line): if force_unbuffered is set, then force a fflush() even if writing to stdout. * sed/execute.c(open_next_file): added handling of the new `force_unbuffered' flag so that slow_getline() will always be used for input. * sed/execute.c(read_file_line): changed the (conditionally compiled) test of `input->is_tty' to (unconditionally) use the new spelling `input->no_buffering'. Thu Oct 15 12:08:09 PDT 1998 Ken Pizzini * configure.in: deleted AC_ARG_PROGRAM call; this is already done for us by AM_INIT_AUTOMAKE, and we were winding up with a doubled-transform. Sun Sep 27 01:42:42 PDT 1998 Ken Pizzini * compile.c(compile_program): remove special-case code for matching address range with a `0' beginning. * compile.c(compile_address): change default addr_number to be a pragmatically impossible countT value, instead of zero. * execute.c: spell macro REGNEXEC() unconditionally instead of playing with conditional definition of regnexec() macro. * execute.c(match_an_address_p): added third argument (and changed callers in match_address_p). Added special code to ignore non-numeric matches when processing "line zero". * execute.c(process_files): added a "line zero" pass through the commands script. Sun Sep 27 00:20:53 PDT 1998 Ken Pizzini * compile.c(xofa,normalize_text): new functions. * compile.c(compile_regex): cache last_compiled_re (with its associated flags); add POSIXLY_CORRECT behavior for empty RE. Make use of the new normalize_text() function. * compile.c(setup_replacement): Make use of the new normalize_text() function. Sat Sep 26 22:59:13 PDT 1998 Ken Pizzini * lib/regex-gnu.h: added missing prototype for regncomp(). Mon Sep 14 20:47:23 PDT 1998 Ken Pizzini * sed/sed.c(main): use EXIT_SUCCESS instead of 0, in case we are built on a system (such as VMS) where EXIT_SUCCESS is distinct from 0. Wed Sep 9 22:17:28 PDT 1998 Ken Pizzini * sed/Makefile.am: added -I../intl the INCLUDES line; if we are building in a directory outside the source tree and the system we are building on does not have a header, then the build was failing, because libintl.h is a build-time constructed source file. * configure.in: tweaked version to be 3.02b. Wed Sep 9 19:28:14 PDT 1998 Ken Pizzini *** Version 3.02a released * sed/compile.c(mark_subst_opts,read_label,compile_program): wherever we accept a ; as a command terminator, also allow a } or a # to appear. (This allows for less cluttered-looking scripts, such as: sed '/foo/{x;G}' (instead of: sed '/foo/{x;G;}').) Wed Sep 9 18:17:07 PDT 1998 Ken Pizzini * sed/compile.c(compile_regex): use regncomp() instead of regcomp(), so that a script with NULs in its REs will work in the expected manner. * sed/compile.c(ADDNUL,REGNCOMP): added support macros for above. * lib/regex.c(regncomp,regcomp): added regncomp() and made regcomp() a simple wrapper function. Mon Aug 31 21:48:30 PDT 1998 Ken Pizzini * sed/sed.c(compile_program): if the first address of a range is the number 0 (or a 0~N sequence), start out in the "a1_matched" state. This allows one to match an initial chunk of a file without undue convolutions for handling the case where the match for the end of the sequence happens to be the first line. Sun Aug 16 03:34:25 PDT 1998 Ken Pizzini * sed/compile.c(snarf_char_class,match_slash): simplify handling of "premature newline" error. Also, get the line number right in the error message if we encounter a "premature newline" during char-class snarfing. Sun Aug 16 02:59:20 PDT 1998 Ken Pizzini * sed/compile.c: added N_() markers and corresponding gettext() (er, _()) calls. * Merged in i18n contribution from Erick Branderhorst . His ChangeLog entry for the changes I've incorporated so far: 1998-07-24 Erick Branderhorst * configure.in (ALL_LINGUAS, AM_GNU_GETTEXT): nl * sed/{sed.h,utils.c}: #include #define _(String) gettext (String) * sed/sed.c: #include * po/POTFILES.in: sed/{compile,execute,sed,utils}.c * run gettextize -f * acconfig.h: #undef LOCALEDIR ENABLE_NLS HAVE_CATGETS HAVE_GETTEXT HAVE_LC_MESSAGES HAVE_STPCPY Fri Aug 14 13:52:57 PDT 1998 Ken Pizzini * Merged code from 3.02 with a branched development tree from late May; the following (out-of-order) changelog entry is from the branched tree. Sat May 30 12:23:16 PDT 1998 Ken Pizzini * sed/compile.c, sed/execute.c: added (conditional on NOLEAKS macro) code to free all dynamically allocated memory. * sed/sed.c, sed/compile.c, sed/execute.c: much shuffling of code --- ordered functions such that no forward declarations are necessary, and placed all static prototypes immediately before the actual function definition. This accomplished two things: first, I find the new ordering a more natural way to read the code than the previous ordering, and second, the new ordering give the compiler a better opportunity to discover inlining possibilities. (The odd "prototype declaration+old-style definition" style is used because I feel it is the least ugly way of supporting K&R1 C while still getting the benefit of prototypes when they are available.) * sed/basicdefs.h: added MEMCPY() macro to hide the VCAST()s that ought to be used with memcpy(). * sed/execute.c: Change calls to memcpy() to go through the new MEMCPY() macro. Various prototypes: elide variable name if it does not add any human-useful documentary information to the bare type. * sed/sed.c(main): Updated calls to compile_string() to add third (length) argument. Changed call to obsolete close_all_files() to a call to the new finish_program(). * sed/sed.c(map_file): Attempt to clean-up how "size" gets cast and tested; remove spurious S_ISREG test (just let mmap() fail if it doesn't support the underlying file type). * sed/sed.c: Deleted old RX library stub declarations. * sed/sed.c(map_file,unmap_file): added VCAST()s to the mmap()/munmap() calls. * sed/utils.c(ck_fclose): added support for ANSI C functionality where passing a NULL argument means to fclose() _all_ open streams. (Well, almost. Only closes streams which were previously ck_fopen()ed, as I don't care to figure out how to autoconf-detect whether fclose(NULL) is properly supported on a given platform.) * sed/sed.h: Renamed `struct text_buf' member `text_len' to `text_length'. Abstracted out `enum addr_types' from `struct addr'; added new enum types num2,step,step_mod; renamed mod to num_mod. De-unionized the regex,number, {modulo-offset/step} components of `struct addr', in anticipation of new features. Changed type of `a2' member of `struct sed_cmd': now a pointer to save space. Abstracted out `struct replacement' from `struct subst'. Cleaned up declaration of `x' union of `struct addr'. Fixed prototype for compile_string(). Replaced prototype for old close_all_files() with one for new finish_program(). * sed/sed.h, sed/compile.c, sed/execute.c: changed to simplify the data structures used for branches and command blocks: simplified `struct vector'; made `struct label' local to compile.c; `struct sed_cmd' was modified to support a simpler design for branches and blocks. * sed/execute.c: Conditionally added ADDNUL() macro so that the function call overhead is only incurred if nul_append() _must_ be called. Made some commentary edits, including typo fixes. * sed/execute.c(resize_line): changed semantics of "len" argument from "additional length" to "target length"; made INITIAL_BUFFER_SIZE a minimum allocation length. * sed/execute.c(str_append): adjusted to new resize_line() semantics. * sed/execute.c(line_copy): use FREE()+MALLOC() instead of REALLOC() to avoid unnecessary copying of old text; add the "try doubling first" allocation heuristic (just like resize_line() does). * sed/execute.c(line_exchange): new function. * sed/execute.c(nul_append): make whole function (not just its body) conditional on HAVE_REGNEXEC macro; adjust to new resize_line() semantics. * sed/execute.c(read_mem_line): use str_append() instead if custom in-line code; compensate for new default of "line.chomped = 0" in read_pattern_space() by setting "line.chomped = 1" where appropriate. * sed/execute.c(read_file_line): use different trigger to determine that "buffer" is uninitialized, and do a full initialization if required; use str_append() instead of custom in-line code in two places; compensate for new default of "line.chomped = 0" in read_pattern_space() by setting "line.chomped = 1" where appropriate. * sed/execute.c(output_line): don't bother calling ck_fwrite() if length==0. * sed/execute.c(release_append_queue): new function. * sed/execute.c(dump_append_queue): use release_append_queue() instead of in-line equivalent. * sed/execute.c(read_pattern_space): conditionalize call to dump_append_queue() for alleged performance reasons; changed default "line.chomped" value to more common "1", and added an assignment of "0" where this made a difference. * sed/execute.c(match_an_address_p): deleted "is_addr2_p" argument; reorder cases to match order in enum declaration; add cases for new "addr_is_num2", "addr_is_step", and "addr_is_step_mod" address types; alter nul_append() call to be through ADDNUL() macro; fix to new struct member and enum spellings in (formerly addr_is_mod); addr_is_num_mod case. * sed/execute.c(match_address_p): remove oblsolete third argument to calls to match_address_p(); alter references to sed_cmd member a2 to reflect new pointer status; add new support for a2->addr_type addr_is_step and addr_is_step_mod cases. * sed/execute.c(do_subst): add NOLEAKS support logic; use ADDNUL() wrapper to nul_append(); simplify replacement expansion by using the new "struct replacement" data structure; use line_exchange() function instead of custom in-line code. * sed/execute.c(process_files): added NOLEAKS code. * sed/execute.c(execute_program): updated implementations of the `{', `}', `:', `b', and `t' commands; modified `c' command gratuituosly; fixed potential memory overrun in `D' command. Simplified how nonstandard `loop increments' work. Use line_exchange() instead of custom in-line code in 'x' case. * sed/execute.c[EXPERIMENTAL_DASH_N_OPTIMIZATION conditional code]: various modifications intended to keep this code in sync with the new changes, but the code still retains its previous bugs. * sed/compile.c: use "exit(EXIT_FAILURE) instead of "exit(1)", just in case we get compiled under VMS. * sed/compile.c: Change type of prog_info.base to decrease needs for casting; then elimiated the casts in question ;-). * sed/compile.c: Added struct sed_label (moved from sed.h, then modified). * sed/compile.c: Removed "readit_p" flag from struct fp_list. * sed/compile.c: Added module-global "blocks" variable. * sed/compile.c: Extracted more error-message constant strings to named variables. * sed/compile.c(check_final_program): updated to reflect new data structures and use new fucntions. Added call to compile_regex() to release unneeded memory. * sed/compile.c: deleted obsolete new_vector() function; abstracted new read_label() function; abstracted new release_label() function; added new `blocks' module-static variable. * sed/compile.c(compile_program): updated implementations of the `{', `}', `:', `b', and `t' commands; modified initialization from NULL vector. * sed/compile.c(compile_regex): added mechanism to release memory consumed by the cached `last' RE. * sed/compile.c(setup_jump,setup_label): updated name (from setup_jump to setup_label) and prototype; changed body to reflect data structure changes. * sed/compile.c: Add OPEN_BRACE and CLOSE_BRACE macros for better "vi" editing behavior. * sed/compile.c(compile_filename,read_filename,get_writefile): Replaced function compile_filename() with more orthogonal functions read_filename(), get_writefile(). * sed/compile.c(compile_regex): Added ability to free the remembered "last RE" in compile_regex (for benifit of "NOLEAKS" code). * Made adjustments dictated by the change to struct sed_cmd which made the a2 member a pointer-to-addr instead of an addr. * sed/compile.c(setup_jump,read_label,setup_label,release_label): Added functions read_label(), setup_label(), release_label(); deleted function setup_jump(). * sed/compile.c(new_replacement,setup_replacement,release_replacement): new functions. * sed/compile.c: Adjusted to new spelling of text_buf member ("text_length" instead of "text_len"). * sed/compile.c(new_vector): deleted function. (Due to new handling of blocks, only one instance remained, and that one was just as clear in-lined.) * sed/compile.c(compile_string): Added third argument; it now takes a counted string instead of a NUL-terminated string. * sed/compile.c(compile_file): added variable "map_base" to compensate for new type of prog_info.base. * sed/compile.c(check_final_program): reflect new style of handling blocks and struct sed_label. * sed/compile.c(close_all_files,finish_program): replaced function close_all_files() with more generic finish_program(). * sed/compile.c(read_text): added new feature: if first non-blank character after the {a,i,c} command character is not "\", then use the trailing text on that line as the (first) line of text. Also added code conditional on NO_INPUT_INDENT to support the "feature" of stripping leading blanks from each input line; I do not read POSIX as permitting this behavior, nor do I think it is a good idea, so it is disabled by default, but some have argued that this blank-stripping is the "correct" behavior, so I offer them the option of building their sed that way. * sed/compile.c(compile_address): added xxx,+n and xxx,~n addressing; simplified code. * sed/compile.c(compile_program): added BAD_PLUS error detection; adjusted to new cur_cmd->a2 pointer status; added addr_is_num2 detection; deleted pointless "a2->addr_number < a1.addr_number" check (addr_is_num2 semantics handle this just fine); updated code for '{', '}', ':', 'b', and 't' to reflect new design of branch handling, including making use of new functions related to the new design); added support for feature already mentioned in read_text() where {a,i,c} commands are able to have their text start on the same line as the command; changed some error messages (hopefully for the better); localized variables specific to individual commands (particularly 's' and 'y'); made use of new setup_replacement() function in 's' command. Mon Aug 10 19:58:49 PDT 1998 Ken Pizzini * doc/sed.texi, doc/sed.1: sedtut10.txt is apparently dead. Deleted references to it and added a pointer to http://seders.icheme.org/tutorials/. (Pointed out by Joerg Heitkoetter .) Sat Aug 8 18:11:57 PDT 1998 Ken Pizzini * djgpp/config.btm: per request by Michel de Ruiter , added "%1" to "%9" parameters. Mon Aug 3 11:44:55 PDT 1998 Ken Pizzini * doc/sed.texi: fix a couple of typos. (Submitted by Alan Modra .) Sat Aug 01 17:49:06 PDT 1998 Ken Pizzini *** Version 3.02 released * configure.in: Because of code change in 3.01a, bump the minor revision number for the release (now 3.02). Sun Jul 26 16:07:55 PDT 1998 Ken Pizzini *** Version 3.01a released * sed/compile.c(snarf_char_class): the POSIX char-class recognition loop forgot to update its concept of "prev" as the loop progressed. * testsuite/Makefile.am: The dependency of version.good on [testsuite/]Makefile introduced in the previous release was botched -- it referred to "Makefile" as "$(srcdir)/Makefile, which of course doesn't work if you aren't building in the source tree. * djgpp/Makefile.am: add forgotten "config.btm" EXTRA_DIST member. * configure.in: update version. Tue Jul 21 06:04:42 PDT 1998 Ken Pizzini *** Version 3.01 released * configure.in: mark as release version! * Makefile.am: add BUGS and THANKS to the EXTRA_DIST target. * testsuite/Makefile.am: add dependency of version.good on [testsuite/]Makefile. Mon Jul 20 12:38:10 PDT 1998 Ken Pizzini * djgpp/config.btm: New file to support the 4DOS alternative to command.com. (Sumitted by Eli Zaretskii on behalf of an anonymous 4DOS user.) Fri Jul 17 00:36:34 PDT 1998 Ken Pizzini *** Version 3.01-beta18 released * djgpp/config.sed: my "tweak" in beta17 was too hastily considered. Back it out. * configure.in: update to beta18. Wed Jul 15 01:02:15 PDT 1998 Ken Pizzini *** Version 3.01-beta17 released * djgpp/config.sed: tweak/simplify s,,, commands at end. * configure.in: update to beta17. 1998-07-14 Eli Zaretskii * djgpp/config.sed: Edit all the occurences of = in the context of --option=value, including in the help messages, into --option:value, but leave DOS-style d:/foo/bar file names intact. * djgpp/config.bat: Use --srcdir:foo instead of --srcdir=foo. * testsuite/Makefile.am (help, version): Remove temporary files explicitly, don't use shell wildcards, so it works under DOS 8+3 limits. Thu Jul 9 13:06:00 PDT 1998 16:51:43 PDT 1998 Ken Pizzini *** Version 3.01-beta16 released * djgpp/config.sed: tweak the configure script to use : instead of = for --with-foo=bar option parsing, to work around problems with how command.com handles =s. Wed Jul 8 16:51:43 PDT 1998 Ken Pizzini * djgpp/config.bat: correct inappropriate behavior that I introduced in the beta13 changes (if first argument is a directory, it needs to be handled as the --srcdir). * testsuite/version.gin, testsuite/version.good, testsuite/Makefile.am: Add target to automake to automatically update version.good from (new file) version.gin, instead of hand-editing the version number each release. * testsuite/Makefile.am: miscellaneous gratuitious tweakage -- mainly adding $(RM) commands just because I didn't like leaving the tmp* files from successful runs laying about. Also some editorial comments. * configure.in: update to beta16. Added and commented out experiment with AC_OUTPUT() for testsuite/version.good. Added code to properly handle bare (without =xxx) "--with-regex" option. Sun Jul 5 21:02:16 PDT 1998 Ken Pizzini *** Version 3.01-beta15 released * sed/utils.c(ck_fflush), sed/utils.h, sed/execute.c(output_line): add and use new ck_fflush() function. Sun Jul 5 15:23:47 PDT 1998 Ken Pizzini * sed/compile.c(bad_prog): add more detail to error messages about -e strings. Sun Jul 5 14:29:45 PDT 1998 Ken Pizzini * sed/compile.c(mark_subst_opts), sed/execute.c(do_subst): Define better semantics for interaction of the `g' flag with a numeric flag to the s/// command. It used to be that the `g' command siezed control; now the first (number-1) matches are skipped and then `g' gets control after that. (It is not clear whether this is a feature sneaking in during late beta, or a bug fix; the changes involved were trivial, so I decided to treat it as a bug fix.) * configure.in, testsuite/version.good: update to beta15. Sat Jul 4 09:54:45 PDT 1998 Ken Pizzini *** Version 3.01-beta14 released * sed/basicdefs.h, sed/compile.c, sed/execute.c: per report by "Kaveh R. Ghazi" , copied the ISXXX macros from lib/regex.c so that silly machines which require isascii() to be true before the other isXXX() macros are valid will still work. * configure.in, testsuite/version.good: update to beta14. Thu Jul 2 23:46:13 PDT 1998 Ken Pizzini *** Version 3.01-beta13 released * configure.in, acconfig.h: set USE_REGEX_GNU_H symbol if we are going to be using lib/regex.c. * lib/Makefile.am, lib/regex.h, lib/regex-gnu.h, lib/regex.c: rename lib/regex.h to lib/regex-gnu.h, so that those who choose to use a different regex implementation will not pick-up lib/regex.h when doing "#include ". * sed/regex-sed.h, sed/Makefile.am, sed/compile.c, sed/execute.c, sed/sed.c: create sed/regex-sed.h which acts as a switch to choose either lib/regex.h or the user-supplied , depending on the value passed to configure's --with-regex= option. Thu Jul 2 17:22:31 PDT 1998 Ken Pizzini * configure.in: if an alternative --with-regex= is given, do an AC_CHECK_FUNCS(regnexec regexec) to ensure that at least one of these functions is available. Also, parallel changes for the default case. * sed/execute.c, acconfig.h: retire use of the WITH_REGNEXEC test macro in favor of HAVE_REGNEXEC test macro created by above change. * djgpp/config.bat: Play games to handle "install-sh", DOS filename restrictions, GNU makefile default rules, and getting a correct run of "configure" (contributed by Eli Zaretskii ). * djgpp/Makefile.am, testsuite/Makefile.am, testsuite/Makefile.in, Makefile.am, configure.in: Various automake targets (such as distcheck) failed with old configuration. The simplest solution was to just add these .am files. (The testsuite/Makefile.in was just renamed to testsuite/Makefile.am, then various redundant defines and targets were deleted.) (Reported by Erick Branderhorst .) * testsuite/dc.good, testsuite/dc.inp: per suggestion from Greg Ubben , use base 16 output to exercise even more of the dc.sed script. * configure.in, testsuite/version.good: update to beta13. Sun Jun 28 16:21:02 PDT 1998 Ken Pizzini *** Version 3.01-beta12 released * doc/sed.texi: Avoid mixing @code and @samp markups together: they look ugly in Info. Use @url and @email instead of @example. Add indexes. (Basis of changes contributed by Eli Zaretskii.) * djgpp/*, Makefile.am: add support for the DJGPP compiler, contributed by Eli Zaretskii . * dc.sed, testsuite/Makefile.in, testsuite/dc.inp, testsuite/dc.good: added this remarkable script, written and contributed by Greg Ubben , both as a work of art for general admiration, and also for use in regression testing. * configure.in, lib/Makefile.am: add --with-regex=regexlib option, which overrides the use of lib/regex.c. * configure.in, testsuite/version.good: update to beta12. Fri Jun 12 16:41:48 PDT 1998 Ken Pizzini *** Version 3.01-beta11 released * sed/compile.c: add module-static variables first_script (for #n change below) and pending_text (for a/c/i change below). * sed/compile.c(compile_file), sed/compile.c(compile_program): Instead of having #n trigger the -n option in *any file*, have #n trigger the -n option only if they are the first two bytes of the first script or script-file. * sed/compile.c(compile_string), sed/compile.c(compile_file): clear the first_script variable at end of these functions. * sed/sed.h: tease out the struct text_buf declaration from struct sed_cmd, so that a pointer to such can be passed to new sed/compile.c(read_text) function. * sed/compile.c(compile_program), sed/compile.c(read_text): Tease out handling of text to a/c/i commands to new read_text() function. Handle (via aid of pending_text variable) texts which span more than one script/script-file option. In particular, restore the ability to have this work: sed -e '1i\' -e 'foo' * sed/compile.c(check_final_program): close off any dangling pending_text allocation. Thu Jun 11 11:17:46 PDT 1998 Ken Pizzini * sed/execute.c(do_subst): fixed two bugs: s/ */X/g was failing to match the final empty string after the end of the pattern space; and /^foo$/s/o/x/3p was printing, despite the failure to do a substition. Fri Jun 5 04:40:24 PDT 1998 Ken Pizzini * configure.in: change the AC_ARG_WITH(regnexec, ...) to be the more appropriate AC_ARG_ENABLE(regnexec, ...). * configure.in, testsuite/version.good: update to beta11. Fri Jun 5 00:54:25 PDT 1998 Ken Pizzini *** Version 3.01-beta10 released * sed/execute.c: forgot to P_() the prototype and old-style the declaration for bootstrap_memchr()! Thu Jun 4 18:42:30 PDT 1998 Ken Pizzini * sed/compile.c(snarf_char_class): added code to recognize \n or \ sequence within a char-class as the newline character. Tue Jun 2 11:56:02 PDT 1998 Ken Pizzini * configure.in: added check for and a AC_ARG_WITH(regnexec,...) check, to simplify use of other regex libraries which have regexec() but not regnexec(), with the corresponding loss of functionality (regexps will not work right against input lines which contain NULs). * sed/execute.c: add nul_append() function, a #define for a regnexec() -> regexec() macro (conditional on the lack of the WITH_REGNEXEC symbol), and a couple of calls to nul_append() (in match_an_address_p() and do_subst()) to permit the use of the POSIX standard regexec() function call instead of the suggested regnexec() call. * sed/compile.c, sed/execute.c, sed/sed.c: check for and include it (before "regex.h") if available. This makes it simpler to use the system's regex library instead of the one in lib/regex.c, should that be desired. Tue Jun 2 08:41:05 PDT 1998 Ken Pizzini * sed/basicdefs.h: define VCAST macros to allow sed to compile on systems which predate the definition of "void *", and yet still get feedback about stupid programming errors from systems which *do* know about "void *"s. Also define MALLOC, REALLOC, MEMDUP, and FREE macros to keep under control the degree of code ugliness which would otherwise be introduced in making use of the VCAST macro. * sed/compile.c, sed/execute.c, sed/sed.c, sed/utils.c: pervasively use the new VCAST, MALLOC, REALLOC, MEMDUP, and FREE macros wherever appropriate. * sed/utils.c, sed/utils.h: correct type of first arguments to ck_fread() and ck_fwrite() to be [const] VOID *. * sed/basicdefs.h, sed/execute.c: protect against the rumored systems which stupidly #define __STDC__ 0. * testsuite/help.good, testsuite/Makefile.in: make the ``help'' test insensitive to the spelling of the executable's name. Also, enhanced `make clean' target. * doc/sed.texi, doc/sed.1: correct documentation of `q' command; fix typos. * configure, testsuite/version.good: update to beta10. Sat May 30 17:28:00 PDT 1998 Ken Pizzini *** Version 3.01-beta9 released * Makefile.am: make testsuite a normal SUBDIR. * configure.in: discontinue using AC_ISC_POSIX -- check for -lcposix library instead; added testsuite/Makefile to AC_OUTPUT list. * lib/memmove.c(memmove): fixed wrong sense used for HAVE_BCOPY test. * sed/execute.c: checked more specifically for a version of gcc which supports __attribute__ (i.e., >= 2.7). * testsuite/*: renamed files to fit 14 char limit. * testsuite/Makefile, testsuite/Makefile.in: Makefile renamed to Makefile.in and then modified so that "make -j check" from top directory will work. * testsuite/subwrite.sed, testsuite/writeout.sed: changed file name of the "w" command to be consistent with the new naming used in testsuite/Makefile.in. * doc/sed.1, doc/sed.texi: fixed some typos, formatting glitches, and poor wordings. Sat May 30 04:02:29 PDT 1998 Ken Pizzini * configure.in: specify that config.h is to be derived from config_h.in in order to avoid the braindead DOS filesystem limitations. Fri May 29 21:56:30 PDT 1998 Ken Pizzini * sed/compile.c(compile_address), doc/sed.texi: gave a better definition to the meaning of N~0 address forms -- N~M addresses now mean that lines match when there exists a non-negative x such that lineno == N+x*M. Fri May 29 12:07:38 PDT 1998 Ken Pizzini * sed/compile.c(compile_address), sed/execute.c(match_an_address_p): update semantics of N~M address form: now N is the first line which will match and M is the step between succeeding matches. If N=M seems more useful. * doc/sed.1, doc/sed.texi: update documentation of N~M address form; added "Other Resources" node to sed.texi; minor formatting changes to some items in sed.1 with an eye to improving clarity. * configure.in, testsuite/version.good: update to beta9. Sat May 23 20:04:31 HST 1998 Ken Pizzini *** Version 3.01-beta8 released * sed/compile.c(compile_regex): forgot to make last_re be a *copy* of the buffered text in today's earlier fix. * sed/execute.c(read_file_line): EOF check was wrong -- it forgot to allow for the possibility that we were appending to the end of the ``line'' (instead of merely reading a fresh line). Sat May 23 18:07:18 HST 1998 Ken Pizzini * sed/compile.c(compile_regex): don't track compiled version of regex -- the modifiers may change. Track the regex source instead. (For "last regex" (aka //) notation.) * configure.in, testsuite/version.good: update to beta8. Sat May 23 16:07:09 HST 1998 Ken Pizzini *** Version 3.01-beta7 released * sed/execute.c: #undef'd EXPERIMENTAL_DASH_N_OPTIMIZATION because its code is buggy. Tue May 19 17:03:52 HST 1998 Ken Pizzini * sed/sed.c: label rx library code as such with #ifdefs (instead of just #if 0). * sed/compile.c(compile_program): make incremental improvement to the "Unknown command" error message. Sat May 16 23:16:26 HST 1998 Ken Pizzini * testsuite/Makefile: simplify: get rid of automatic run against system's sed; don't time by default; allow for alternative comparison command. * configure.in, testsuite/version.good: update to beta7. Wed May 13 21:44:28 PDT 1998 Ken Pizzini *** Version 3.01-beta6 released * lib/Makefile.am: fix spelling of libsed_a_LIBADD in libsed_a_DEPENDENCIES. * configure.in, testsuite/version.good: update to beta6. Wed May 13 14:38:08 PDT 1998 Ken Pizzini *** Version 3.01-beta5 released * sed/execute.c(do_subst): added not_bol_p variable to track when we have iterated past the beginning of the pattern. [Thanks to Jim Meyering for the bug report.] Wed May 13 13:54:04 PDT 1998 Ken Pizzini * sed/execute.c(bootstrap_memchr): new function. When bootstrapping we don't know if we are on a 64-bit machine, so lib/memchr.c breaks. Supply this (slow) implementation just to get us bootstrapped. * bootstrap.sh: add a #define BOOTSTRAP symbol; add -I. for emphasis for the compiles in sed/; be explicit about what files we're bothering to compile. * configure.in, testsuite/version.good: update version to beta5. Wed May 13 06:39:06 PDT 1998 Ken Pizzini *** Version 3.01-beta4 released * rename writeout.good? to wrtout?.good and subwrite.good? to subwrt?.good to comply with DOS 8+3 file name restrictions. [Eli Zaretskii suggested this to simplify DJGPP ports, and it was easy.] * testsuite/Makefile: reflect above name changes. Wed May 12 21:09:32 PDT 1998 Ken Pizzini * sed/sed.c(usage): fix non-portable omission of \n\ at end of lines within long string. * sed/sed.c(main): remove spurious argument to fprintf() in the 'V'ersion output. * sed/execute.c(line_append): embed newline between the two text fragments unconditionally. * sed/execute.c(do_subst): change structure assignment to memcpy() (for portability reasons). * README.bootstrap: suggest using -w option. Tue May 12 10:02:37 PDT 1998 Ken Pizzini * configure.in: use AC_REPLACE_FUNCS where appropriate. * lib/Makefile.am: updated to reflect AC_REPLACE_FUNCS change in configure.in. * lib/memchr.c lib/memcmp.c: revert to standard GNU versions. * lib/alloca.c: added this missing file. * testsuite/version.good: updated for new version identifier. Mon May 11 18:50:56 PDT 1998 Ken Pizzini *** Version 3.01-beta3 released * sed/Makefile.am: fix INCLUDES to work right with VPATH. [Thanks to Jim Meyering for the bug report.] * sed/sed.c(usage): make --help output more user-friendly? * sed/execute.c(execute_program): fix bug in 'x' command introduced in the alleged portability fix of May 9. * configure.in: update version to 3.01-beta3. * testsuite/version.good, testsuite/help.good: freshen with latest output. Sat May 9 22:35:45 PDT 1998 Ken Pizzini *** Version 3.01-beta2 released * sed/sed.c: add #include in HAVE_MMAP block (needed on some machines). * lib/memmove.c: #include , if HAVE_MEMORY_H. Sat May 9 21:29:00 PDT 1998 Ken Pizzini * configure.in: remove dangling references to rx library; added HEADER and FUNC checks for items used by source in lib/. * lib/ansidecl.h, lib/memcopy.h, lib/pagecopy.h, lib/string.h lib/memcpy.c, lib/memmove.c: deletes these files. There are still pieces of glibc missing to support these, and it isn't worth the headache right now. * lib/memmove.c: de novo, simpler version. Uses bcopy() if available, and slow-but-simple code if not. * lib/Makefile.am: remove references to deleted files. Added forgotten reference to memcpy.c. Re-ordered SOURCE entries to reflect dependencies for systems which lack ranlib. * sed/basicdefs.h: updated to reflect above changes to lib/, and experience with non-STDC compilers. * lib/regex.c: made regerror() function publicly visible. * lib/strerror.c: use old-style function declaration. * sed/compile.c, sed/execute.c, sed/sed.c, sed/utils.c, sed/sed.h, sed/utils.h: ensure that private definitions of some symbols do not cause problems when #include'ing system headers (mainly by re-ordering the #include directives). (This is particularly an issue for bootstrap.sh runs.) * sed/execute.c (execute_program): use memcpy() instead of structure assingment ('x' command), for portablility to old compilers. * sed/execute.c (slow_getline): use old-style function declaration, with a P_ prototype. * sed/sed.c: change the type of the fallback MAP_FAILED definition to work on archaic systems. (Modern systems should be defining it themselves, so the change from void * shouldn't be a problem.) * bootstrap.sh, README.bootstrap: actual testing of bootstrap code revealed that I was too optimistic. Redesigned and replaced implementation. * testsuite/Makefile: ignore errors from reference-implementation seds that aren't up to snuff. * testsuite/help.good, testsuite/version.good: update to current version's output. Fri May 8 15:08:28 PDT 1998 Ken Pizzini *** Version 3.01-beta1 released * sed/sed.c (main, usage): once again tweak the --help and --version output to bettery comply with GNU coding standards. * testsuite/help.good, testsuite/version.good: update to reflect above change. * doc/sed.texi: fix "Invoking" node's spelling to comply with GNU standards. Fri May 8 11:43:10 PDT 1998 Ken Pizzini * doc/sed.1, doc/Makefile.am: wrote (very basic) man page. Thu May 7 20:40:21 PDT 1998 Ken Pizzini * lib/Makefile.am, lib/memmove.c, lib/memchr.c, lib/regex.c, lib/memcpy.c, lib/regex.h, lib/memcopy.h, lib/string.h, lib/pagecopy.h, lib/ansidecl.h: grab yet-another-version from gnu.org for baseline and/or edit copyright boilerplate using official lgpl2gpl.sed script. Take care not to loose regnexec() interface or special conditional-compilation code. Wed May 6 23:35:12 PDT 1998 Ken Pizzini * lib/regex.c, lib/regex.h: take from grep-2.1 distribution, then trivially added the regnexec() interface. * sed/sed.c, sed/compile.c, sed/execute.c: made modifications to work with regex instead of rx. * rx/*: deleted directory; the code is just too slow. I think it will be easier to extend regex to fully support POSIX.2 than to tune rx to be reasonable. Even if this supposition is wrong, I'd rather make the 3.01 release with the slightly deficient regex. * Makefile.am lib/Makefile.am, sed/Makefile.am: made changes related to the substitution of regex for rx. * lib/Makefile.am, sed/Makefile.am: since regex is not a ``compatability'' module, changed name of library to ``libsed.a''. * lib/memchr.c, lib/memcpy.c, lib/memmove.c: add conditional compilation code to leave zero-sized .o file if system already supports the implemented function. * testsuite/help.good, testsuite/version.good: brought up-to-date (once again). * NEWS, ANNOUNCE: changes to reflect this batch of changes. Wed May 6 18:40:47 PDT 1998 Ken Pizzini * sed/execute.c: discovered awful bug in '}' handling: it could read past the end of vec (because `n' was being decremented below zero)! Needed to "continue" instead of "break". Tue May 5 14:34:38 PDT 1998 Ken Pizzini * doc/sed.texi, doc/version.texi: wrote some rudimentary texinfo documentation. * ANNOUNCE, NEWS, README, README.rx, Makefile.am: more updates for the upcoming beta-release. * sed/compile.c, sed/execute.c, sed/sed.c, sed/utils.c, sed/sed.h, lib/strerror.c: update copyright notice text. Fri May 1 15:41:37 PDT 1998 Ken Pizzini * sed/execute.c (match_an_address_p, match_address_p): if the second element of an address range is a line number, and that line number is *less than* (or equal to) the current line number, we only match the one line (per POSIX.2, section 4.55.7.1). [Bug discovered as reported in the seders mailing list FAQ.] * AUTHORS, NEWS, acconfig.h, configure.in, doc/Makefile.am, lib/Makefile.am, sed/Makefile.am, lib/README, testsuite/help.good, testsuite/version.good: Updated in anticipation of the 3.01-beta1 release. Reorganized development source tree to make creation of a distribution simpler. Most notable changes were to the various Makefile.am files and configure.in, but some minor edits (such as deleting or changing #include directives) have been made in many other source files. * bootstrap.sh, README.bootstrap: created a mechanism for creating sed on a system which lacks a working sed. Thu Apr 16 23:52:11 PDT 1998 Ken Pizzini * sed.h, sed.c, execute.c, compile.c: did a spell-check on the comments; fixed several typos. Thu Apr 16 13:43:01 PDT 1998 Ken Pizzini * execute.c (do_subst): fixed bug where the "replaced" flag was being set to one inappropriately when at least one but fewer than sub->numb matches of the regexp were found. (Thanks to Simon Taylor for the bug report.) Wed Apr 15 11:35:31 PDT 1998 Ken Pizzini * sed.h, sed.c, compile.c, execute.c: having a concern that a cast was being done inappropriately, and realizing that there is no quick way to locate all casts in a program, I went through and marked all casts with a simple macro. Now it is a simple matter to locate the casts, and it is also a simple matter to turn of casts for a lint session (if it should be desired). Wed Apr 15 10:29:21 PDT 1998 Ken Pizzini * compile.c, sed.c: redo compile phase so that brace expressions can be spread across multiple files. For example: printf '{' >a; printf 'l;d' >b; printf '}' >c sed -f a -f b -f c foo will now compile (and work), instead of complaining about an unmatched '{'. The mess created in compile.c allowed a little simplification to the command-line processing of "-e" options in sed.c. sed.h: added (opaque) err_info member to struct vector; added comments to the members of struct vector. Wed Apr 14 23:50:50 PDT 1998 Ken Pizzini * sed.h, sed.c, compile.c, execute.c: added types countT and flagT in order to clarify what various "int"s were doing. Also makes it easy to change the type used for counts (for example, to "unsigned long long") if desired, although there are still some gotchas (such as the printf() format for the '=' command). Tue Apr 14 17:34:54 PDT 1998 Ken Pizzini * execute.c (execute_program, process_files, count_branches, shrink_program): Added a first attempt at program optimization. We now can quit early if we are running with the "-n" and all of the commands are known to be valid only for lines less than the current line. Thus the "sed" in "foo | sed -n 1,2p" will print read three lines, printint the first two, and then quit, regardless of how much longer "foo" might run or output. This optimization does not buy much in most cases (it sometimes even costs a little), but when it does help it can help big. The code is all conditionally compiled based on the EXPERIMENTAL_DASH_N_OPTIMIZATION symbol being #defined, so it can be easily omitted if it causes problems. Tue Apr 14 12:25:06 PDT 1998 Ken Pizzini * execute.c (test_dollar_EOF, last_file_with_data_p): test_dollar_EOF() was incorrectly returning a false (0) when there were unprocessed files, none of which had any data (either unopenable or zero-length). Created last_file_with_data_p() to detect this situation, and modified test_dollar_EOF() to make use of it. Thu Apr 2 23:02:18 PST 1998 Ken Pizzini * compile.c (match_slash): match_slash() did not handle [.coll.], [=equiv=], and [:class:] sequences within a character class. Added snarf_char_class() [which is a remote derivative of parse_char_class() from GNU ed-0.2] to deal with the details, and altered match_slash() to make use of it. Also created the trivial add_then_next() to avoid clutter in snarf_char_class(). Thu Apr 2 20:34:42 PST 1998 Ken Pizzini * execute.c, sed.c, sed.h: There was a severe bug in how the code handled "sed 5n a b" when "a" consists of exactly five lines -- it behaved like "sed 5q a b"! Rearranged where files get opened -- large scale changes primarily involving main(), process_files(), and read_pattern_space(), but also touching on several other parts of execute.c. The read_pattern_space() function became unwieldly and parts were split into open_next_file(), closedown(), read_always_fail(), read_mem_line(), and read_file_line(). The at_end_of_file_p() function became obsolete and was eliminated; test_dollar_EOF_p() was updated. A few global and module-static variables were elminated, and "struct line" was extended; comments were added to the "struct line" declartation to document some important dependencies in it. I undertook the reorganization with dread, but I feel that the new organization is an improvement well beyond just fixing the bug that inspired it. Thu Apr 2 01:16:25 PST 1998 Ken Pizzini * execute.c (read_file_line, slow_getline): the fread() buffering code gives insufficient feedback to a user running sed with a tty input device, so I created slow_getline() for reading from a tty device. Additionally, EOF detection has been made a little more sensitive to avoid requiring multiple EOFs to be entered from a tty. * configure.in: added isatty() check. Wed Apr 1 11:04:30 PST 1998 Ken Pizzini * configure.in (CPPFLAGS, LDFLAGS, LIBS): Set to appropriate values if large file support needs explicit enabling. Code fragment taken from a 1997-10-25 patch to gawk by Paul Eggert Thu Aug 14 17:43:27 PDT 1997 Ken Pizzini * utils.c (ck_fclose): modified to ignore NULL parameter. Thu Aug 14 12:08:45 PDT 1997 Ken Pizzini * execute.c: tweaked execute_program() to eliminate gratuitous "goto" usage. Thu Aug 14 11:30:04 PDT 1997 Ken Pizzini * compile.c: added case-insensitive modifier ('I') to address and s/// regexps. The s/// case also accepts the more popular 'i' modifier. (The address regexp cannot use 'i' as a modifier, as that conflicts with the use of the 'i'nsert command.) Thu Aug 14 09:29:06 PDT 1997 Ken Pizzini * compile.c: abstracted out match_slash() from the s///, y///, and address-regexp special-case codes. * execute.c: made dump_append_queue() use ck_fread() instead of hand-rolled error checking. Mon Jul 28 10:50:41 PDT 1997 Ken Pizzini * sed.c, sed.h, execute.c: POSIX.2, section 4.55.7, says that a newline must end *every* output line. But I think that it is useful (when seding a binary file) to omit a trailing newline if the input lacks one. Thus the addition of POSIXLY_CORRECT behavior. * execute.c: however, when seding multiple files my feeling is that it makes sense to have each file but the last behave as-if it ended in a newline. Modified read_pattern_space() accordingly. * utils.c: realized that add1_buffer(), for performance reasons, shouldn't be calling memcpy() (indirectly via add_buffer()), so rewrote it. Sat Jul 26 23:08:28 PDT 1997 Ken Pizzini * execute.c: attempted to make read_pattern_space more efficient for the the non-mmap() case. * utils.c, utils.h, execute.c: new function ck_fread() created and used. Sat Jul 26 20:22:14 PDT 1997 Ken Pizzini * execute.c, compile.c, sed.c: abstracted the mmap() interface into map_file()/unmap_file() [sed.c], and changed the ad-hoc code in compile_file() [compile.c] and process_file() [execute.c] to make use of the new interface. Sat Jul 26 19:45:46 PDT 1997 Ken Pizzini * execute.c, compile.c, configure.in: Check to see if mmap() is available; if so make use of it on regular files. * compile.c: compile_file() now closes the input file when it is through! Sun Jul 20 23:57:02 PDT 1997 Ken Pizzini * compile.c: modified parsing to permit whitespace in more places where it makes sense; added backslash escaping to the y/// command, per POSIX. * execute.c: Merged append_pattern_space() into read_pattern_space(); moved body of 's' command to new function do_subst(); moved body of 'l' command to new function do_list(); changed output of 'l' command to conform to POSIX.2; made line handling conform to POSIX; added output_line() function; redesigned append-space algorithm; added append_queue structure and the next_append_slot() and dump_append_queue() functions. * sed.h: moved the definition of what is now struct subst outside of the definition of struct sed_cmd. Sat Jul 19 16:29:09 PDT 1997 Ken Pizzini * sed.c, execute.c, sed.h, Makefile.am: Separated out the pieces dealing with executing the program from the top-level parameter parsing and control. Sat Jul 19 01:16:35 PDT 1997 Ken Pizzini * sed.c, compile.c, sed.h, Makefile.am: separate out the pieces dealing with compiling the program from the pieces dealing with interpreting the result. * compile.c: add functions in_nonblank() and in_integer(), and change interface to compile_address() with an eye to making code clearer. Fri Jul 18 13:35:50 PDT 1997 Ken Pizzini * utils.c: attempt at a quasi-unification of the STDC and traditional C approaches to panic(). * sed.c: eliminate some gratuitous bit twiddling. (Using flag bits can be a useful technique, but this code is cleaner without them.) * sed.c: place mutually exclusive members of struct addr within a union, mainly to document the exclusivity; eliminate unused structure members from struct fp_list; eliminate unnecessary module-global variables; remove some #if 0 code that is too odd to keep; allegedly simplified the 'l' case of execute_program(); allegedly simplified inchar(); localized some static variables; renamed some variables to better document their purpose; removed some goto-s rendered obsolete by other changes. Thu Jul 17 15:30:44 PDT 1997 Ken Pizzini * utils.c, utils.h, sed.c: added and made use of ck_free() function. * utils.c, utils.h, sed.c: changed all the *_buffer() functions to take/return an incomplete type "struct buffer *" instead of using VOID *. * utils.c, utils.h, sed.c: renamed "finish_buffer()" to "free_buffer()", on the premise that the new name better describes the function's purpose. Wed Jul 16 13:52:14 PDT 1997 Ken Pizzini * utils.c, utils.h, sed.c: added and made use of ck_memdup() function. * sed.c: protected a call to add1_buffer() in compile_program() which could have tried to push an EOF if a a/i/c command ended with a '\', EOF sequence. * utils.c: added sanity check to add1_buffer() so that EOF will not be added to the buffer. Wed Jul 16 03:56:26 PDT 1997 Ken Pizzini * configure.in, compat.h, compat.c: added memchr. * sed.c: got rid of arbitrary NUM_FPS limit; made global functions and variables "static" where appropriate; make various cosmetic changes, hopefully improving readability; simplified some redundant predicates; simplified some code, but nothing fundamental (yet?). Wed Jul 16 00:24:54 PDT 1997 Ken Pizzini * alloca.c, getopt.c, getopt.h, getopt1.c: updated from versions in textutils-1.22. * Makefile.in, Makefile.am, configure.in: put in automake support. * basicdefs.h, compat.h, compat.c [, sed.c, utils.c]: took out some very ugly compatibility #ifdefs and packaged into one place. * sed.c, utils.c: some gratuitous formatting changes. * utils.c: changed datatype of utils_id_s in order to eliminate arbitrary array size. Sun Jul 13 17:00:26 PDT 1997 Ken Pizzini * sed.c, utils.c, utils.h: de-linting oriented cleanup. Sun Jul 13 00:46:48 PDT 1997 Ken Pizzini * sed.c: fixed bug which caused SEGV for files missing a final newline. Corrected calls to regnexec to pass the proper parameters, in the proper order. Sat Dec 30 20:16:59 1995 Tom Lord *** Version 3.00 released * sed.c: Use posix entry points to regexp functions. Fix enough bugs to pass the test-suite. ....... Jason Molenda * testsuite/: trippy test suite. Wed May 11 07:46:24 1994 Chip Salzenberg (chip@fin.uucp) *** Version 2.05 released * sed.c (compile_address): Recognize numeric addresses. Fixes typo made during installation of "~" feature. Sat Apr 30 17:17:38 1994 Tom Lord (lord@x1.cygnus.com) *** Version 2.04 released * sed.c: applied a patch from From: kap1@tao.cpe.uchicago.edu (Dietrich Kappe) Dietrich writes: As my contribution to the creeping feature creature in sed, here is a new type of address. The address has form n~m, which means "the line number is equal to n modulo m." The modifications to sed are trivial, and the general usefulness of this address should be obvious. If m is 0 or missing, 1 is used in its place (could be a bug or a feature :-). Sat Apr 30 17:17:38 1994 Tom Lord (lord@x1.cygnus.com) * rx.c (solve_destination): protect `solution' more carefully. This is a cleanup of a patch from Kevin Buettner (kev@cujo.geg.mot.com). Sat Apr 30 17:17:38 1994 Tom Lord (lord@x1.cygnus.com) * rx.c: make translation tables unsigned chars * sed.c (main): Compile accumulated -e commands as soon as a -f command comes along. This ensures that the commands are executed in the right order. Mon Oct 25 14:41:47 1993 Tom Lord (lord@rtl.cygnus.com) * sed.c (execute_program): 'w' flushes the buffer after it writes -- diagnosed by doug@research.att.com. 'r' and 'w' to the same file is now supported -- hopefully even in a way that satisfies Posix (it now behaves differently from some /bin/sed's and the spec is hard to read so i'm not sure). Also, 'r' of a non-existent file is now permitted. Mon Oct 11 21:06:10 1993 Tom Lord (lord@cygnus.com) * sed.c (execute_program): remember that 'b' and 't' are more like longjmp than goto. Patch from tom@basil.icce.rug.nl (Tom R.Hageman) * rx.c: patch from From: fin!chip@rutgers.edu (Chip Salzenberg) to get rid of compiler warnings. Sat Aug 7 01:04:59 1993 Tom Lord (lord@unix7.andrew.cmu.edu) *** Version 2.03 released * sed.c (compile_regex): report error messages for bogus regexps. SEE ALSO: ChangeLog.rx Wed Jul 21 00:28:03 1993 Tom Lord (lord@unix8.andrew.cmu.edu) * alloca.c: upgraded to a more recent version * rx.c (re_search_2): prefer matches with longer subexpressions to those with shorter ones, giving precedence to low numbered subexpressions. * rx.c (re_compile): don't free `params' if its null. Fri Jul 16 01:12:08 1993 Tom Lord (lord@unix8.andrew.cmu.edu) * rx.[ch], sed.c: rx replaces regex. Thu May 27 11:13:03 1993 Tom Lord (lord@unix3.andrew.cmu.edu) * sed.c (execute_program, match_addr): caught more cases that need to be sensitive to a missing \n at EOF. Fri May 21 00:39:22 1993 Tom Lord (lord@unix8.andrew.cmu.edu) * sed.c (execute_program): apply gaumondp's patch to fix '\xabcxs/foo/bar/'. * sed.c (execute_program): If a second address is a regexp, never match it on the same line as the first address. * sed.c (compile_regexp): Numeric ranges x,y s.t. y < x are now treated as x,x. There was a bug in that they were being handled like x,x+1. * sed.c (execute_program, read_pattern_space, append_pattern_space) don't add newlines to lines that don't have them. Wed May 19 13:34:45 1993 Tom Lord (lord@unix9.andrew.cmu.edu) * sed.c (compile_program): grok \\n in comments. Mon May 17 16:34:50 1993 Tom Lord (lord@unix9.andrew.cmu.edu) * alloca.c: new (standard) file * configure.in: AC_CONSTified * sed.c (compile_program): properly diagnose the error of a missing command (e.g. sed /x/). (thanks gaumondp) * sed.c (compile_regexp): handle character classes correctly. Thanks gaumondp@ERE.UMontreal.CA and schwab@issan.informatik.uni-dortmund.de. Thu May 6 12:37:18 1993 Tom Lord (lord@unix10.andrew.cmu.edu) * sed.c (compile_filename, execute_program): don't use `access' or `/dev/null'. * sed.c (execute_program): 'N' at EOF should delete the pat buf. * sed.c (compile_filename): truncate, don't append files being openned for `w' or `s///w' * sed.c (execute_program): -n switch shouldn't effect `i' or `c'. * sed.c (compile_program): don't compile unescaped newlines into the substitution string of an `s' command (they are an error). * sed.c (compile_regex): correctly skip over character sets that contain `]'. * sed.c (execute_program): patch from gaumondp Correctly handle empty-string matches in the case of an `s' command with a repeat count. * sed.c (compile_program): patch from gaumondp@ere.UMontreal.ca. Don't consume characters after the label of a `b', `t' or `:' command. * sed.c (compile_program): unmatched open braces are an error. * sed.c (compile_file): when consuming an initial comment, count lines correctly. Wed Nov 18 02:10:58 1992 Tom Lord (lord@unix2.andrew.cmu.edu) * sed.c (execute_program): Made s///p print even if -n was specified. * sed.c (compile_string): Changed the type of this function to fix a compile warning. Wed Nov 4 17:15:34 1992 Tom Lord (lord@unix7.andrew.cmu.edu) * sed.c (main): Initialize the hold area to contain "\n" instead of "". In execute_program, all lines are expected to be newline terminated. Also, if H is the first command in the script, the result is a pattern buffer that begins with a blank line. Thanks to pinard@iro.umontreal.ca (Francois Pinard) for pointing out this and many other bugs. * sed.c (execute_program): Fixed a case of `D' command. Thanks Chris Weber * sed.c: added new tests of no_default_output to make -n work. Thanks Andrew Herbert * sed.c, configure.in,Makefile.in: autoconfed bcopy and const. Thanks "J.T. Conklin" * sed.c: made prog_cur, prog_start, and prog_end unsigned so that users could write `sed -e s/ÿ/foo/g'. Tue Oct 13 00:04:05 1992 Tom Lord (lord@unix3.andrew.cmu.edu) * sed.c (execute_program): fixed the cycling behavior of 'D' * sed.c: integrated patch that closes files * sed.c: changed regexp syntax Fri May 22 15:11:12 1992 Tom Lord (lord at moriarty.bh.andrew.cmu.edu) * regex.c: this is not my change, but a pointer to the fact that karl@gnu fixed some regexp bugs that were plaguing sed. Thu Apr 30 13:02:21 1992 Tom Lord (lord at unix3.andrew.cmu.edu) * sed.c (compile_program, execute_program) subprograms are now compiled with an explicit continuation ;) return_v and return_i in struct vector. execute_program no longer recurses to execute subprograms (case '{') and now understands a return instruction (case '{'). Tue Apr 28 17:13:04 1992 Tom Lord (lord at unix7.andrew.cmu.edu) * sed.c (compile_address) added \?regexp? syntax for addresses. * sed.c (main) added {} intervals to the obscure regexp syntax. * sed.c (compile_program) after calling compile_address, normalize numeric addresses (make a2.addr_number > a1.addr_number). This is necessary because line numbers must match exactly, but sed does not try to match a2 until after a1 has matched, yet a1,a2 where a2 <= a1 is defined to be equivelent to a1,a1+1 Sat Feb 29 10:55:54 1992 David J. MacKenzie (djm@nutrimat) * sed.c (usage): Document long options as starting with `--'. Mon Dec 9 23:56:40 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) * sed.c: Include sys/types.h, for new regex.h. Tue Nov 5 02:16:01 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) * utils.c: Change NO_VFPRINTF to VPRINTF_MISSING, for compatibility with autoconf. Mon Sep 2 22:02:40 1991 David J. MacKenzie (djm at apple-gunkies) * sed.c (compile_regex): Treat \ as a normal character when in a char class. Thu Aug 8 00:15:33 1991 David J. MacKenzie (djm at bleen) * Version 1.08. * sed.c (compile_filename): If reading a file fails, read /dev/null instead. It's what Unix and POSIX do, effectively. * sed.c (compile_regex): The 'slash' character doesn't terminate the regex if it's in a character class. * sed.c (main): If given no args, or bad option, print usage message. (usage): New function. * sed.c (execute_program): Amount written for 'P' command was wrong. From stephend@ksr.com (Stephen Davis). Wed Aug 7 16:51:14 1991 David J. MacKenzie (djm at apple-gunkies) * sed.c (append_pattern_space): Check for buffer full before instead of after writing to buffer. Don't need to test for EOF initially anymore, due to the next change. (execute_program): For 'n' and 'N' commands, if eof is reached in input, quit the script like Unix sed does. Fix memory allocation problems for 'a' and 'r' commands. (compile_program): Fix off by one error in processing comments. All of the above are from Tapani Tarvainen, tarvaine@tukki.jyu.fi. * sed.c (setup_jump): Use isblank instead of testing for ' ' or '\t', for POSIX locales. * utils.c (ck_strdup): Renamed from strdup. * sed.c: Change callers. * sed.c, utils.c: Clean up declarations and includes to get rid of compiler warnings. * sed.c (main): Add long-named options. Don't complain if -n is given twice. Fri Aug 2 12:33:16 1991 David J. MacKenzie (djm at apple-gunkies) * configure: Support +srcdir arg. Create config.status and remove it and Makefile if interrupted while creating them. * Makefile.in: Change DESTDIR to prefix. Mon Jul 15 13:07:39 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu) * sed.c (main): Add -V option to print version number. (USAGE): Mention -V. Mon Jul 8 01:42:22 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu) * sed.c: Define bcopy in terms of memcpy if STDC_HEADERS as well as if USG. (compile_filename): Don't glob filename (for 'r' and 'w' commands). Unix sed doesn't do it and it's not very useful, since it can only match 0 or 1 files. (execute_program): Change '\a' to 007 since some compilers don't recognize \a. * utils.c: New file; code moved from sed.c. * Replace Makefile with Makefile.in and configure. Update README. Tue Mar 26 13:00:48 EST 1991 Jay Fenlason (hack@gnu.ai.mit.edu) * sed.c (match_address) Added a trivial cast for portability. Mon Feb 25 13:23:29 EST 1991 Jay Fenlason (hack@ai.mit.edu) * sed.c Changed 's' command to work with latest version of regex() routines, which mysteriously changed somewhere in there. . . A one-line patch from David Eckelkamp (eckelkamp@mcc.com). Initialize the fastmap in the hopes that it'll make sed faster. Thu Feb 21 13:42:27 EST 1991 Jay Fenlason (hack@ai.mti.edu) * sed.c Change panic to compile with other __STDC__ compilers. Wed Jan 30 10:46:38 EST 1991 Jay Fenlason (hack@ai.mit.edu) * sed.c Changed version number. Made new release. Tue Nov 27 15:34:51 EST 1990 Jay Fenlason (hack@ai.mit.edu) * sed.c (setup_jump) Don't blow chunks if there isn't a label after a b or t command. (main) Don't panic if it a branch command doesn't have a label to branch to. (main) Collect all the -e arguments together and parse them all at once. This way, -e { -e mumble -e } will work. All these small patches from David Schmidt (davids@isc-br.isc-br.com) Tue Sep 11 12:51:37 EDT 1990 Jay Fenlason (hack@ai.mit.edu) * sed.c Changed some function forward declarations to use VOID * instead of char * Mon Jul 16 11:12:54 EDT 1990 Jay Fenlason (hack@ai.mit.edu) * sed.c (ck_malloc) Use malloc(1) instead of malloc(0) if given a request for zero bytes. Tue Jun 5 02:05:37 1990 David J. MacKenzie (djm at albert.ai.mit.edu) * sed.c: Remove excess newlines from calls to panic. Reformat some comments to fit in 79 columns. Base whether to use void * on __STDC__, not __GNU__. (main): Add missing arg when printing usage message. Print usage if given invalid arg. (panic) [__STDC__]: Add missing ", ...". (compile_filename): Print correct error message if glob_filename returns NULL. Thu Apr 5 21:41:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) * sed.c (execute_program, case 'r'): When need to realloc append.text, multiply append.alloc by 2 instead of adding cur_cmd->x.cmd_txt.text_len. Tue Mar 6 15:55:35 EST 1990 Jay Fenlason (hack@ai.mit.edu) * sed.c (compile_regex) Allocate 10 bytes extra space needed by re_compile_pattern. Sun Feb 25 16:32:10 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu) * sed.c (execute_program, case 'l'): Print \00 instead of \0. Print backslash as \\ not \. Print \xx instead of /xx. Thu Feb 1 14:02:28 EST 1990 hack@wookumz * sed.c (memchr) Use () inside inner loop so it will work correctly. A two character patch from Robert A Bruce (rab@allspice.berkeley.edu) Wed Sep 27 18:47:39 EDT 1989 hack@ai.mit.edu * sed.c (compile_regex) New function. When compiling regex, turn ^ into \` and $ into \' so that they won't match on embedded newlines. UN*X pattern matching is a crock. (compile_program, compile_address) call compile_regex. Mon Sep 18 10:15:32 EDT 1989 hack@ai.mit.edu * sed.c (compile_program): define translate as unsigned char * so that y command will work on non-ascii characters. Changed version number to 1.06. Thu Sep 14 15:57:08 EDT 1989 hack@ai.mit.edu * sed.c (compile_program) Let programs use ; to terminate } as well as newline. (read_file) Print an error msg to stderr if it can't open an input file. Thu Mar 23 18:04:46 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu) * Makefile, sed.c: Added new copyright notice. * Makefile: Make distributions which follow the symlinks. hack@ai.mit.edu 1.05 Fixed error in 'r' (now does things in the right order) 1.04 Fixed s/re/rep/[number] 1.03 Fixes from Mike Haertel for regexps that match the empty string, and for Ritchie stdio (non-sticky EOF) 1.02 Fixed 't', 'b', ':' to trim leading spaces and tabs Fixed \\ in replacement of 's' command Added comments 1.01 Added s/re/rep/[digits] added #n as first line of script added filename globbing added 'l' command All in the name of POSIX 1.00 Began (thinking about) distributing this file Local Variables: mode: indented-text left-margin: 8 version-control: never End: