1 2006-02-03 Paolo Bonzini <bonzini@gnu.org>
3 * sed/compile.c (compile_program) <case 'y'>: Pass false to match_slash.
5 2005-09-07 Paolo Bonzini <bonzini@gnu.org>
7 * lib/regcomp.c: Update from upstream.
8 * lib/regex.c: Update from upstream.
9 * lib/regex_.h: Update from upstream.
10 * lib/regex_internal.c: Update from upstream.
11 * lib/regex_internal.h: Update from upstream.
12 * lib/regexec.c: Update from upstream.
14 2005-08-30 Paolo Bonzini <bonzini@gnu.org>
16 * sed/execute.c (reset_addresses): Never activate ADDR_IS_NUM_MOD
18 * testsuite/modulo.good, testsuite/modulo.inp, testsuite/modulo.sed:
20 * testsuite/Makefile.tests: Add new testcase.
21 * testsuite/Makefile.am: Add new testcase.
22 * testsuite/Makefile.in: Regenerate.
24 2005-05-18 Maciej W. Rozycki <macro@linux-mips.org>
26 * configure.ac: Use a cache variable for the libcP test.
27 * configure: Regenerate.
29 2005-05-16 Eero Hakkinen <eero17@bigfoot.com>
31 * sed/compile.c (snarf_char_class): Fix handling of
34 2005-04-04 Paolo Bonzini <bonzini@gnu.org>
36 * sed/execute.c (process_files): Do not add a default
37 command-line in in-place editing mode.
39 2005-02-10 Paolo Bonzini <bonzini@gnu.org>
41 * testsuite/Makefile.tests: Add new testcase.
42 * testsuite/Makefile.am: Add new testcase.
43 * testsuite/Makefile.in: Regenerate.
44 * testsuite/appquit.good, testsuite/appquit.inp,
45 testsuite/appquit.sed: New testcase.
46 * testsuite/readin.sed: Quit after the last r command.
47 * testsuite/readin.good: Adjust.
48 * sed/execute.c (execute_program): Dump the results of the
49 a/r/R commands just before quitting.
51 2005-02-10 Paolo Bonzini <bonzini@gnu.org>
53 * sed/regexp.c: Fix off-by-one error in the "invalid reference
54 to subexpression" message. Debian bug 294339.
56 2005-02-08 Paolo Bonzini <bonzini@gnu.org>
58 * lib/obstack.h: include config.h.
60 2005-02-01 Paolo Bonzini <bonzini@gnu.org>
62 * doc/Makefile.am: Don't enable MAKEINFO_HTML and TEXI2HTML_HTML
63 rules unless BUILD_HTML.
65 2005-01-25 Paolo Bonzini <bonzini@gnu.org>
67 * sed/regexp.c: Fix building on GCC 2.95 and earlier.
69 2004-12-26 Paolo Bonzini <bonzini@gnu.org>
71 Do not use leftmost-longest matching for addresses.
73 * NEWS: Add a note about this.
74 * testsuite/recall2.good, testsuite/recall2.inp,
75 testsuite/recall2.sed: New test.
76 * testsuite/Makefile.am, testsuite/Makefile.tests: Add the
78 * sed/sed.h (struct regex): New.
79 (struct addr, struct subst, compile_regex, match_regex,
80 release_regex): Use it instead of regex_t.
81 * sed/compile.c (compile_program): Update for new meaning of
82 the third parameter of compile_regex.
83 * sed/execute.c (do_subst): Pass less conservative value to
84 the regsize parameter of match_regex.
85 * sed/regexp.c (compile_regex_1): New, extracted out of
86 compile_regex. The third parameter, needed_sub, now includes
87 \0 (so 10 means that \0 .. \9 are needed). Pass RE_NO_SUB
88 if needed_sub is zero.
89 (compile_regex): Accept a struct regex instead of a regex_t.
90 Save the regular expression's text.
91 (match_regex): Accept a struct regex instead of a regex_t.
92 Recompile the pattern if it was compiled with RE_NO_SUB.
93 (release_regex): Accept a struct regex instead of a regex_t.
95 * doc/Makefile.am: Generate sed.texi correctly when
96 building outside srcdir.
98 2004-12-26 Paolo Bonzini <bonzini@gnu.org>
100 * BUGS: Add section about [a-z] matching uppercase characters,
101 and other locale issues.
102 * doc/sed-in.texi [!PERL]: Likewise.
104 2004-11-15 Paolo Bonzini <bonzini@gnu.org>
106 * sed/execute.c (str_append_modified): Copy the first character
107 when using \l or \u in a multi-byte configuration. Use
108 WCRTOMB instead of wcrtomb.
109 * sed/sed.h (WCRTOMB): New.
111 2004-11-11 Paolo Bonzini <bonzini@gnu.org>
113 * tst-rxspecer.c: Do not mix instructions and
115 * basicdefs.h: Include locale.h before #defining
116 gettext, to avoid breakage under Solaris.
117 * sed/sed.c: do not include locale.h.
119 2004-11-03 Paolo Bonzini <bonzini@gnu.org>
121 * bug-regex11.c: Improve portability.
122 * bug-regex12.c: Improve portability.
123 * bug-regex13.c: Improve portability.
124 * bug-regex14.c: Improve portability.
125 * bug-regex21.c: Improve portability.
126 * bug-regex9.c: Improve portability.
127 * tst-boost.c: Improve portability.
128 * tst-pcre.c: Improve portability.
129 * tst-regex.c: Improve portability.
130 * tst-rxspencer.c: Improve portability.
132 2004-10-08 Paolo Bonzini <bonzini@gnu.org>
134 * lib/utils.c (utils_id_s): Renamed to open_files.
135 (struct id): Renamed to struct open_file.
137 2004-10-08 Jakub Jelinek <jakub@redhat.com>
139 * testsuite/Makefile.tests (bug-regex*, run-tests,
140 run-ptests): Use $(SED).
141 (version): Likewise; prepend $(SED) invocation with $(SEDENV).
143 2004-08-16 Paolo Bonzini <bonzini@gnu.org>
145 *** Version 4.1.2 released.
147 2004-08-06 Paolo Bonzini <bonzini@gnu.org>
149 * sed/compile.c (bad_command): Fix off-by-one error.
150 (snarf_char_class): Fix problem with [.....[] (i.e.
151 last char in class is a bracket.
153 2004-06-30 Paolo Bonzini <bonzini@gnu.org>
155 *** Version 4.1.1 released.
157 2004-06-29 Paolo Bonzini <bonzini@gnu.org>
159 * sed/compile.c (mark_subst_opts): Return int.
160 * sed/execute.c (open_next_file): Fix uninitialized
163 2004-06-10 Paolo Bonzini <bonzini@gnu.org>
165 *** Version 4.1 released.
167 2004-03-25 Paolo Bonzini <bonzini@gnu.org>
169 * lib/obstack.h: Get current version.
171 2004-03-13 Paolo Bonzini <bonzini@gnu.org>
173 Exit as soon as possible on an I/O error, and with
174 a better error message.
176 * lib/utils.c (ck_mkstemp, ck_rename, ck_getline): New
177 functions. Save temporary files into utils_id_s.
178 (struct id): Add a field named temp.
179 (ck_fopen): Init the new temp field of struct id.
180 (panic): Unlink temporary files before exiting.
181 * sed/execute.c (read_file_line): Use ck_getline.
182 (closedown): Use ck_rename.
183 (open_next_file): Use ck_mkstemp.
185 2004-01-20 Paolo Bonzini <bonzini@gnu.org>
187 * sed/sed.h (enum addr_state): New definition.
188 (enum addr_type): Remove ADDR_IS_NUM2.
189 (struct sed_cmd): Replace a1_matched with range_state.
190 * sed/compile.c (next_cmd_entry): Use range_state.
191 (compile_program): Death to ADDR_IS_NUM2. Compile
193 * sed/execute.c (match_address_p): Rewritten. Handle
195 (match_an_address_p): Suit to new match_address_p.
196 (execute_program): Adjust to use range_state in `c'.
197 Handle addr_bang here.
198 (reset_addresses): Use range_state.
200 (struct input): New field "reset_at_next_file".
201 (read_pattern_space): Use it instead of "separate_files".
202 (process_files): Initialize it.
204 2004-01-17 Paolo Bonzini <bonzini@gnu.org>
206 * sed/sed.h: Do not include wchar.h and wctype.h, and do
207 not include the alloca stuff.
208 * basicdefs.h: Move all that here.
210 2004-01-15 Paolo Bonzini <bonzini@gnu.org>
212 * sed/regexp.c [REG_PERL]: Use REG_STARTEND instead of regexec2.
214 2004-01-09 Paul Eggert <eggert@twinsun.com>
215 Paolo Bonzini <bonzini@gnu.org>
217 * sed/sed.h (posixicity): New variable, replaces POSIXLY_CORRECT.
218 * sed/sed.c (main): Set it.
219 * sed/compile.c: Use it instead of POSIXLY_CORRECT.
220 * sed/execute.c: Use it instead of POSIXLY_CORRECT.
221 * doc/sed-in.texi: Document it and --posix.
223 2004-01-05 Paul Eggert <eggert@twinsun.com>
224 Paolo Bonzini <bonzini@gnu.org>
226 * NEWS: Fix [\n] to match either backslash or n in POSIXLY_CORRECT mode.
227 * doc/sed-in.texi: Document this. Also, document regular expressions
228 a bit better overall, using terminology that's more similar to POSIX.
229 * sed/sed.h (enum text_types): New definition.
230 * sed/compile.c (normalize_text): Replace final parameter with one of
231 type normalize_text. If TEXT_REGEX and in POSIXLY_CORRECT mode,
232 grok character classes without replacing \n inside them.
234 2004-01-03 Paolo Bonzini <bonzini@gnu.org>
236 * sed/execute.c (execute_program): print final line
237 after executing N, if not POSIXLY_CORRECT.
239 2003-12-28 Paolo Bonzini <bonzini@gnu.org>
241 * sed/compile.c: fix "\\\n" in RHS of s command.
242 Reported by Mike Castle.
243 * testsuite/bkslashes.inp, testsuite/bkslashes.good,
244 testsuite/bkslashes.sed: New files.
245 * testsuite/Makefile.am, testsuite/Makefile.tests: Add
248 2003-12-16 Paolo Bonzini <bonzini@gnu.org>
250 *** Version 4.0b released.
252 * sed/mbcs.c: New file.
253 * sed/sed.h: Declare macros for mbcs.c.
254 * sed/compile.c: Use them.
255 (brlen): Moved to mbcs.c.
256 * sed/execute.c: Use them.
257 * sed/sed.c: call initialize_mbcs ().
259 2003-12-14 Paolo Bonzini <bonzini@gnu.org>
261 * sed/regex.c (match_regex): fix memory leak.
263 2003-11-27 Paolo Bonzini <bonzini@gnu.org>
265 * sed/execute.c (reset_addresses): leave addresses 0
268 2003-11-15 Jakub Jelinek <jakub@redhat.com>
270 * sed/regex.c: Use fastmap.
272 2003-09-21 Paolo Bonzini <bonzini@gnu.org>
274 *** Version 4.0a released.
276 * sed/execute.c (struct line): Add mbstate field.
277 (str_append): Keep mbstate up to date.
278 (str_append_modified): Likewise, and use towupper/towlower.
279 (line_init): Initialize mbstate.
280 (line_copy): Copy mbstate.
281 (line_append): Copy mbstate.
283 2003-07-15 Stepan Kasal <kasal@ucw.cz>
284 Paolo Bonzini <bonzini@fnu.org>
286 Change the way we treat lines which are not terminated by a newline.
287 Such lines are printed without the terminating newline (as before)
288 but as soon as more text is sent to the same output stream, the
289 missing newline is printed, so that the two lines don't concatenate.
291 * sed/execute.c (output_file): Is now struct output; users adjusted
292 to access the fp field, call output_missing_newline before, and
293 call flush_output afterwards.
294 (read_file_line): Set line.chomped FALSE each time we encounter a
295 line without the newline terminator, no matter whether this is the
296 last input file or not, and no matter whether we are in
297 POSIXLY_CORRECT mode or not.
298 (output_missing_newline): New function which prints the suppressed
299 newline, if necessary.
300 (flush_output): New function for a common pattern.
301 (output_line): Use struct output, set its flag accordingly.
302 (dump_append_queue): Use `ck_fwrite' instead of output_line.
303 (do_list): Flush the output stream at the end.
304 (closedown): The code ``if(separate_files) rewind_read_files();''
305 (read_pattern_space): ... has been moved here.
306 (process_files): Don't do the default `p' at the end, ...
307 (execute_program): ... as this function is now responsible for it;
308 add the code to the end of the function and to the command `q';
309 the commands `d', `D' and `Q' thus no longer have to forge an empty
311 (execute_program): Commands `c' and `i' no longer call the
312 function output_line with chomped==FALSE; instead, they chomp
313 the text and call the function with chomped==TRUE.
314 (execute_program): Command `e' no longer uses output_line; it
315 calls ck_fwrite directly. Commands `e', `L' and `=' flush
316 the output stream at the end.
317 * sed/compile.c (special_files): Use `struct output' instead of the
319 (get_openfile): ... special files are no longer copied to file_read
321 (fp_list): Move to sed.h (users adjusted) and rename as...
322 * sed/sed.h (struct output): ...this. New flag missing_newline
323 associated to the output stream.
324 (struct sed_cmd, struct subst): Use `struct output *' instead of mere
325 `FILE *'; adjust compile.c and execute.c.
326 * testsuite/noeolw.sed, testsuite/noeolw.good, testsuite/noeolw.1good,
327 testsuite/noeolw.2good: New tests
329 2003-07-15 Stepan Kasal <kasal@ucw.cz>
331 * lib/utils.h, sed/sed.h: #include "basicdefs.h",
332 don't include it from various *.c files.
333 * sed/regex.c: Don't include regex.h as it's included via sed.h.
335 2003-06-11 Paolo Bonzini <bonzini@gnu.org>
337 * lib/getline.c: Don't realloc with first param = NULL.
339 2003-05-07 Paolo Bonzini <bonzini@gnu.org>
341 * sed/execute.c: Make treatment of ADDR_IS_NUM_MOD
342 simpler, and fix bugs in 0~5,+1
343 * sed/compile.c: Complain about addresses like 0
344 and 0,3 which are sources of misunderstandings.
345 Reported by Akim Demaille <akim@epita.fr>
347 2003-03-25 Paolo Bonzini <bonzini@gnu.org>
349 *** Version 4.0.7 released
351 * sed/execute.c (append_replacement): Extract from
353 (do_subst): Don't update count when a match was
355 * testsuite/xbxcx3.good, testsuite/xbxcx3.sed,
356 testsuite/xbxcx3.inp: Regression tests
358 2003-03-23 Paolo Bonzini <bonzini@gnu.org>
360 * sed/execute.c (do_subst): Fix several bugs with
362 * testsuite/numsub2.good, testsuite/numsub2.inp,
363 testsuite/numsub2.sed, testsuite/numsub3.good,
364 testsuite/numsub3.inp, testsuite/numsub3.sed,
365 testsuite/numsub4.good, testsuite/numsub4.inp,
366 testsuite/numsub4.sed, testsuite/numsub5.good,
367 testsuite/numsub5.inp, testsuite/numsub5.sed:
368 regression tests for the bugs
370 2003-03-15 Paolo Bonzini <bonzini@gnu.org>
372 *** Version 4.0.6 released
374 * lib/mkstemp.c: Include sys/file.h if available for the
377 2003-03-14 Paolo Bonzini <bonzini@gnu.org>
379 * sed/compile.c: Replace flagT with bool
380 * sed/execute.c: Replace flagT with bool
381 * sed/fmt.c: Replace flagT with bool
382 * sed/sed.c: Replace flagT with bool
383 * sed/regex.c: Replace flagT with bool
385 2003-03-13 Paolo Bonzini <bonzini@gnu.org>
387 * sed/compile.c (compile_program): Understand parameter
390 * sed/sed.c (usage): Split help message into multiple
392 (main): Don't understand -h and -V
394 2003-03-12 Paolo Bonzini <bonzini@gnu.org>
396 * sed/compile.c (match_slash, snarf_char_class): More
397 multibyte character support
398 (brlen): New function
399 * testsuite/classes.good, testsuite/classes.inp,
400 testsuite/classes.sed: New files
402 2003-03-10 Paolo Bonzini <bonzini@gnu.org>
404 * sed/compile.c (match_slash): Strip the \ in front of
405 slashes (so that the matcher sees x/ for s/x\///). Don't
406 match / and [ unless at the start of a character.
408 2003-02-18 Paolo Bonzini <bonzini@gnu.org>
410 * sed/regex.c (compile_regex): // matches the last regular
411 expression even in POSIXLY_CORRECT mode.
412 * sed/compile.c (normalize_text): Treat multibyte character
414 (read_text): Don't swallow backslash sequences, run text
415 through normalize_text
416 (compile_program): Ditto for y command
418 * sed/compile.c (normalize_text): Add parameter that says
419 whether the text will be processed further to remove more
420 backslash escapes. Callers adjusted
421 (match_slash): Remove same parameter from here. Callers adjusted.
423 2003-02-15 Paolo Bonzini <bonzini@gnu.org>
425 * sed/sed.h: Fix prototype for match_regex, declare re_registers
427 * sed/execute.c (do_subst): Use re_registers
428 * sed/regex.c (copy_regs): New function
429 [REG_PERL]: Use re_registers
430 [!REG_PERL]: Avoid using internal entry points, support pre-glibc
431 2.3 regex for the sake of --without-included-regex.
433 2003-01-04 Paolo Bonzini <bonzini@gnu.org>
435 * sed/sed.h: Move some stuff from here...
436 * sed/basicdefs.h: ...to here
437 * lib/utils.c (ck_fopen): Add FAIL parameter
438 * lib/utils.h: Adjust parameter
439 * sed/compile.c, sed/execute.c, sed/sed.c: Adjust callers
441 * sed/basicdefs.h: Add TRUE/FALSE
442 * sed/compile.c, sed/execute.c, sed/sed.c: Use them
443 * sed/fmt.c: Do not redefine them
445 2003-01-02 Paolo Bonzini <bonzini@gnu.org>
447 * sed/sed.c: Bump copyright year
449 2002-12-24 Paolo Bonzini <bonzini@gnu.org>
451 * sed/sed.c: Use bindtextdomain
452 * sed/basicdefs.h [__EMX__]: Define initialize_main
453 * lib/getline.c [__EMX__]: Strip trailing CR
455 * sed/regex.c: Don't use N_ on the lines that define
456 error messages, some compilers complain.
458 2002-12-18 Paolo Bonzini <bonzini@gnu.org>
460 *** Version 4.0.5 released
462 * sed/compile.c: Don't use N_ on the lines that define
463 error messages, some compilers complain.
465 2002-12-16 Paolo Bonzini <bonzini@gnu.org>
467 * sed/compile.c: Improvements to some error messages;
468 `a', `i', `l', `L', `r' accept two addresses except in
469 POSIXLY_CORRECT mode.
471 2002-12-14 Paolo Bonzini <bonzini@gnu.org>
473 * lib/regex_internal.c: Fix problem on non-glibc
474 systems, from Jakub Jelinek
475 * lib/regex.c (RE_ENABLE_I18N): Conditionalize on
476 HAVE_MBRTOWC and HAVE_WCRTOMB.
477 * lib/getline.c: Fix compilation on non-glibc system
478 * lib/snprintf.c: Fix compilation on non-glibc system
479 * lib/basicdefs.h [P_]: Make more portable
481 2002-12-12 Paolo Bonzini <bonzini@gnu.org>
483 *** Version 4.0.4 released
485 2002-11-21 Paolo Bonzini <bonzini@gnu.org>
487 *** Version 4.0.3 released
489 2002-11-19 Paolo Bonzini <bonzini@gnu.org>
491 *** Version 4.0.2 released
493 2002-11-05 Paolo Bonzini <bonzini@gnu.org>
495 *** Version 4.0.1 released
497 2002-10-23 Paolo Bonzini <bonzini@gnu.org>
499 *** Version 4.0 released
501 2002-10-28 Paolo Bonzini <bonzini@gnu.org>
503 * lib/utils.c: Don't fail for EBADF in fflush
504 * src/sed.c: the_program is now a global
506 2002-10-19 Paolo Bonzini <bonzini@gnu.org>
508 * src/sed.c: Print GNU sed in --version for GNU sed,
509 and super-sed for super-sed (thanks to Bruno Haible)
511 2002-10-17 Paolo Bonzini <bonzini@gnu.org>
513 *** Version 3.96 released
515 2002-10-16 Isamu Hasegawa <isamu@yamato.ibm.com>
517 * src/execute.c (execute_program): Multibyte 'y'
518 * src/compile.c (compile_program): Likewise
519 * src/sed.h: Likewise
521 2002-10-08 Paolo Bonzini <bonzini@gnu.org>
523 *** Version 3.95 released
525 2002-07-15 Paolo Bonzini <bonzini@gnu.org>
527 * src/sed.h: rfile --> fname, wfile --> fp
528 * src/compile.c (compile_command): Parse 'R' like 'w', use
529 separate lists for file read and file write
530 * src/compile.c (get_openfile): New name of get_writefile
531 * src/compile.c (rewind_read_files): New function
532 * src/sed.h: Declared here
533 * src/execute.c (closedown): And called here
534 * src/execute.c (append_queue): Added 'free' field
535 * src/execute.c (execute_program): Implement 'R'
537 2002-06-09 Paolo Bonzini <bonzini@gnu.org>
539 * src/execute.c (do_subst): Replaced flag was set on every
540 regexp match, while the first matches should not set it
543 2002-06-08 Paolo Bonzini <bonzini@gnu.org>
545 * src/compile.c (compile_file): Open the script in text mode
546 * lib/utils.c (utils_fp_name): Shorten the output
547 * lib/utils.c (ck_fread, ck_fwrite, ck_fflush): Clearerr
548 after printing an error.
549 * lib/utils.c (ck_fclose): Work on stdout as well if stream == NULL
550 and flush before closing to check for errors
552 2002-05-30 Paolo Bonzini <bonzini@gnu.org>
554 * src/compile.c (compile_program): Implement W
555 * src/execute.c (execute_program): Likewise
557 2002-04-23 Paolo Bonzini <bonzini@gnu.org>
559 * src/sed.c (usage, main): Parse -s
560 * src/sed.h (separate_files): New variable
561 * src/execute.c (separate_files): New variable
562 * src/execute.c (reset_addresses): New function to make range
563 addresses work separately on each file when using in-place
565 * src/execute.c (execute_program): The `n' and `N' use test_eof
566 so that the script restarts at end of file, not at end of input
567 * src/execute.c (test_dollar_EOF): Make $ work separately
568 on each file when using -s; renamed to test_eof
570 2002-02-28 Paolo Bonzini <bonzini@gnu.org>
572 * src/sed.h (struct sed_cmd): exit_status -> int_arg
573 * src/compile.c: Likewise
574 * src/execute.c: Likewise
576 * src/compile.c (compile_command): Parse `l' like
577 `q' and `Q'; default for int_arg is -1
578 * src/execute.c (do_list): New argument, used instead
580 (execute_program): Interpret int_arg for the `l' command;
581 return 0 for `q' and `Q' if int_arg is -1
583 * src/fmt.c: New file, looted from GNU textutils
584 * src/compile.c: Parse `L'
585 * src/execute.c: Execute `L'
587 2002-02-14 Paolo Bonzini <bonzini@gnu.org>
589 * src/execute.c (str_append_modified): Fixed a stupid
590 bug (stop condition was *start == *end, meant to be
593 2002-02-05 Paolo Bonzini <bonzini@gnu.org>
595 * lib/utils.c: Added directory parameter to
597 * lib/utils.h: Adjusted
598 * src/execute.c: Adjusted
600 2002-01-29 Paolo Bonzini <bonzini@gnu.org>
602 * src/compile.c (mark_subst_opts): Signal an error if
603 there are multiple g or p options
604 * src/compile.c (compile_program): Raise appropriate
605 error if second string in y command is longer than
606 first (used to be "excess junk after command")
608 2001-12-31 Paolo Bonzini <bonzini@gnu.org>
610 * lib/getline.c: Strip the terminating \r under Windows
613 * testsuite/xemacs.sed, testsuite/xemacs.inp,
614 testsuite/xemacs.good: Submitted by John Fremlin
617 2001-12-27 Paolo Bonzini <bonzini@gnu.org>
619 * sed/execute.c (do_subst): Flags in optimized s/^xx/
620 commands were discarded (see the change below)
622 2001-12-19 Paolo Bonzini <bonzini@gnu.org>
624 * sed/execute.c (resize_line): Limit inactive space to two
626 * sed/execute.c (line_init): Initialize buf->active
627 * sed/execute.c (str_append, str_append_modified, line_copy,
628 do_list, do_subst, execute_program, process_files): Operate
631 * sed/execute.c (do_subst): Optimize s/^xx// by making a part
632 of the buffer inactive and s/xx$// by truncating it.
633 * sed/execute.c (execute_program): Optimize D by making a part
634 of the buffer inactive
636 * testsuite/uniq.sed, testsuite/uniq.inp, testsuite/uniq.good:
637 added to test P and D commands.
638 * testsuite/fasts.sed, testsuite/fasts.inp, testsuite/fasts.good:
639 added to test the new optimization done on the `s' command.
641 2001-12-17 Paolo Bonzini <bonzini@gnu.org>
643 * testsuite/dc.inp: Also compute Easter of 2002 :-)
645 * sed/execute.c [!HAVE_FCHMOD]: Don't chmod the output file
648 2001-11-12 Paolo Bonzini <bonzini@gnu.org>
650 * sed/sed.h (struct sed_cmd): a1 is a pointer too
651 * sed/compile.c: Likewise
652 * sed/execute.c: Likewise
654 * sed/compile.c: Use obstacks
655 * sed/execute.c: Likewise
657 2001-11-09 Paolo Bonzini <bonzini@gnu.org>
659 * sed/compile.c (mark_subst_opts): Parse option `e',
660 preserve two occurrences of the `e' and `p' options.
661 * sed/execute.c (do_subst) [HAVE_POPEN]: Interpret option
662 `e' (evaluate, like Perl's but uses Bourne shell).
663 * sed/sed.h (struct subst): Add an `eval' flag.
665 * sed/compile.c (compile_program): Compile command `e'
667 * sed/execute.c (execute_program): Execute command `e'.
669 2001-09-25 Paolo Bonzini <bonzini@gnu.org>
671 * sed/compile.c (get_writefile) [!POSIXLY_CORRECT]:
673 * sed/execute.c (open_next_file, closedown): Support
675 * sed/execute.c (backup_file_name): New function to
676 support in-place editing
677 * sed/main.c (usage, main): Parse -i.
678 * sed/utils.c: Moved to lib directory
680 * lib/utils.c (temp_file_template): New function.
681 * sed/utils.h: Declared temp_file_template.
683 2001-09-05 Paolo Bonzini <bonzini@gnu.org>
685 * sed/execute.c (do_subst): `baaac', if passed through
686 s/a*/x/g, gave `xbxxcx' rather than `xbxcx' (because an
687 empty string matched before the `c'. Fixed.
689 * sed/execute.c: Removed mmap support, I/O is done using
690 getline (slower but more bug-proof).
691 * sed/utils.c: Likewise.
692 * lib/getline.c: New file
694 2001-03-22 Paolo Bonzini <bonzini@gnu.org>
696 * sed/compile.c (normalize_text) [POSIXLY_CORRECT]: Enable
697 escapes in modes other than BRE.
699 2001-03-21 Paolo Bonzini <bonzini@gnu.org>
701 * sed/compile.c (normalize_text): Support \XXX in Perl mode,
702 \oXXX in non-Perl mode.
704 2001-03-18 Paolo Bonzini <bonzini@gnu.org>
706 * sed/compile.c (compile_program): Fixed missing break when
707 compiling 'q' and 'Q'.
709 * sed/compile.c (check_final_program): Removed now spurious
710 call to compile_regex
711 * sed/regex.c (compile_regex): Don't track the last compiled
713 * sed/regex.c (execute_regex): Track here the last compiled
716 2001-03-02 Paolo Bonzini <bonzini@gnu.org>
718 * sed/compile.c (setup_replacement): Support \[lLuUE] like
720 * sed/compile.c (new_replacement): Accept new parameter
722 * sed/sed.h (enum replacement_types): New declaration
723 * sed/execute.c (do_subst): Use new function str_append_modified
724 to apply the changes required via \[lLUuE].
725 * sed/execute.c (str_append_modified): New function
727 2001-03-02 Paolo Bonzini <bonzini@gnu.org>
729 * sed/compile.c (setup_replacement): Count the number of backreferences
731 * sed/regex.c (compile_regex): Check if there is a sufficient number
732 of backreferences (new argument needed_sub replaces nosub)
733 * sed/compile.c (compile_address, compile_program,
734 check_final_program): Callers adjusted
736 2001-02-08 Paolo Bonzini <bonzini@gnu.org>
738 * sed/compile.c (compile_program): Added `Q' (quit without output)
739 * sed/execute.c (execute_program): Ditto
741 * sed/compile.c (compile_program): Fill in exit_status for `q' and `Q'
742 * sed/execute.c (execute_program): Return -1 for `go on', 0..255
743 to set the exit status
744 * sed/execute.c (process_files): Interpret new convention for
745 execute_program, return sed's exit code
746 * sed/sed.c (main): Return process_files's exit code
747 * sed/sed.h (struct sed_cmd): Declare exit_status
749 2001-01-07 Paolo Bonzini <bonzini@gnu.org>
751 * sed/compile.c (compile_program): Added `T' (branch if failed)
752 * sed/execute.c (shrink_program, execute_program): Ditto
754 2001-01-04 Paolo Bonzini <bonzini@gnu.org>
756 * testsuite/Makefile.am: Use automake's implementation
757 of `make check'. Removed the test targets
758 * testsuite/Makefile.tests: Moved the test targets here
760 * testsuite/runtest: New file
762 * testsuite/Makefile.tests: `khadafy' test uses EREs.
764 * testsuite/spencer.inp: Removed the ^* test
766 * testsuite/spencer.sh: Don't rely on awk; more comments too
768 2001-01-03 Paolo Bonzini <bonzini@gnu.org>
770 * sed/compile.c(snarf_char_class) [REG_PERL]: Don't parse
772 * sed/compile.c(match_slash) [REG_PERL]: Ditto
774 * sed/compile.c(read_text) [REG_PERL]: Support [xX] modifiers
775 * sed/compile.c(mark_subst_opts) [REG_PERL]: Ditto
777 2000-12-21 Paolo Bonzini <bonzini@gnu.org>
779 * lib/snprintf.c [BOOTSTRAP]: Don't include stdio.h
780 * lib/strerror.c [BOOTSTRAP]: Don't include stdio.h
781 * sed/execute.c [!HAVE_ISATTY]: Don't buffer stdin
783 2000-12-11 Paolo Bonzini <bonzini@gnu.org>
785 * sed/compile.c(mark_subst_opts): Support [mMsS] flags
786 * sed/compile.c(read_text): Support [MS] flags for
788 * sed/regex.c(compile_regex): Support arbitrary flags for
791 * sed/regex.c(compile_regex) [REG_PERL]: Don't call
794 2000-12-08 Paolo Bonzini <bonzini@gnu.org>
796 * basicdefs.h: Moved here from the `sed' subdirectory.
798 * configure.in: Removed crap to pick a regex engine.
799 Added snprintf to the AC_REPLACE_FUNCS call.
801 * lib/snprintf.c: New file.
803 * sed/regex.c(compile_regex): Use regncomp
804 * sed/regex.c(match_regex): Use regexec2
806 * sed/compile.c(compile_program): Implemented the `v' command.
808 * sed/sed.c(main): Implemented the `r' and `R' options
810 * sed/sed.h: Replaced use_extended_syntax_t with
811 extended_regexp_flags to support Perl regular expressions.
813 * sed/execute.c(open_next_file): Don't mmap stdin (because
814 we cannot seek into it, so a redirected stdin's contents
815 would not be "eaten" by sed)
817 Mon Aug 30 23:40:08 PDT 1999 Ken Pizzini <ken@gnu.org>
819 *** Version 3.02.80 released
821 * sed/execute.c(do_subst): lib/regex.c(re_search_2) seems to
822 want one extra backreference register; humor it.
824 * sed/regex.c(compile_regex): work around some odd assumptions
825 that lib/regex.c(re_compile_pattern) makes about our desired
828 * configure.in: tweaked version to 3.02.80; added new entries
829 to the ALL_LINGUAS definition.
831 * doc/sed.1, doc/sed.texi, BUGS: explicitly request the output
832 of sed --version in bug-reporting instructions.
834 * doc/sed.texi: the old "informal seders list" is dead; document
835 the new sed-users mailing list instead (under Other Resources).
838 Thu Aug 19 23:27:54 PDT 1999 Ken Pizzini <ken@gnu.org>
840 * sed/sed.h: Add explicit #include of "regex-sed.h" (rather
841 than relying on parent file doing so); change the "cmd_regex"
842 member of sed_cmd: make it a pointer (instead of a struct),
843 and change its name to cmd_subst; add prototypes for newly
844 exported functions bad_prog(), normalize_text(), compile_regex(),
845 match_regex(), and release_regex(); drop rx_testing variable.
847 * sed/compile.c: move the compile_regex() function to regex.c;
848 export bad_prog() and normalize_text() functions; eliminate the
849 rx_testing debris; rename the NOLEAKS symbol to more descriptive
850 DEBUG_LEAKS; make cmd_regex to cmd_subst fixes (see above);
851 make use of newly abstracted release_regex() function.
853 * sed/execute.c: abstract out the regex matching to
854 regex.c:match_regex(); NOLEAKS to DEBUG_LEAKS change;
855 cmd_regex to cmd_subst structure member name change.
857 * sed/execute.c(do_subst): use re_registers/regoff_t instead of
858 regmatch_t to hold the backreference registers, make "offset"
859 always be relative to the beginning of the string (rather than
860 a delta from "start"), defer some matching bookkeeping (e.g.,
861 not_bol_p) to match_regex().
863 * sed/sed.c(main): loose rx_testing variable; NOLEAKS
864 (aka DEBUG_LEAKS) code attempting to release
865 _nl_current_default_domain is problematic, so omit it.
867 * sed/regex.c: new file --- abstracts out the interface to the
868 regex engine so that less conditional code is required in
869 compile.c and execute.c, and so as to make a change of engine
870 easier; implements compile_regex() (which looks an awful lot
871 like the one that used to live in compile.c), match_regex(),
872 and (if DEBUG_LEAKS is set) release_regex().
874 Sun Apr 18 04:40:46 PDT 1999 Ken Pizzini <ken@gnu.org>
876 * sed/sed.c(main): conditionalize calls to setlocale() and
877 textdomain() to only occur if their support is needed/wanted.
879 Sun Apr 18 03:01:46 PDT 1999 Ken Pizzini <ken@gnu.org>
881 * bootstrap.sh: "foo || bar && baz" was not grouping like I
882 expected ("foo || (bar && baz)") under at least one shell,
883 so change the test for a pre-existing config.h file to an
886 * bootstrap.sh: added -DUSE_REGEX_GNU_H option to the
887 compiler invocation, to ensure that we get a usable
888 regex library included.
890 Sun Apr 18 02:59:42 PDT 1999 Ken Pizzini <ken@gnu.org>
892 * sed/sed.h, sed/utils.c: conditionalized inclusion of <libintl.h>
893 to occur only if ENABLE_NLS is defined.
895 Sun Apr 18 01:48:45 PDT 1999 Ken Pizzini <ken@gnu.org>
897 * sed/compile.c(xofa,normalize_text,convert_number): change
898 name of xofa() function to convert_number(); change semantics
899 to do all of the work of the text->number conversion.
901 * sed/compile.c(normalize_text): add new \dDDD decimal
902 and \oOOO octal escapes.
904 Sun Mar 28 21:05:07 PST 1999 Ken Pizzini <ken@gnu.org>
906 * sed/sed.c(main): if NOLEAKS is set, free up a word that
907 the call to textdomain() allocated.
909 * sed/execute.c(read_file_line): plug up (minor) memory leak:
910 if buffer.alloc==0 we may have malloc()'d 1 byte anyway,
911 so be sure to FREE(buffer.text) before calling line_init();
913 Fri Mar 26 16:52:10 PST 1999 Ken Pizzini <ken@gnu.org>
915 * sed/compile.c(match_slash): somewhere between 3.02
916 and 3.02a we lost the ability to use a newline as
917 the s/// delimiter; restore this ability.
919 * sed/compile.c(compile_regex): forget about trying
920 to cache the compiled form of the last RE --- it
921 causes more problems than its worth. We now only
922 cache the source form.
924 * testsuite/help.good: update to reflect output containing
927 Sun Dec 6 00:51:23 PST 1998 Ken Pizzini <ken@gnu.org>
929 * sed/utils.c(ck_fwrite): fix i18n bug of using a printf
930 fragment of "item%s" to handle plural text.
932 Mon Nov 23 11:03:40 PST 1998 Ken Pizzini <ken@gnu.org>
934 * doc/sed.1, doc/sed.texi: ran ispell over these
935 files to catch the more obvious typos...
937 Sun Nov 1 00:09:07 PST 1998 Ken Pizzini <ken@gnu.org>
939 * sed/execute.c(do_list): make a `lcmd_out_line_len'
940 (--line-length) of zero mean "infinite length",
943 Sat Oct 31 23:06:50 PST 1998 Ken Pizzini <ken@gnu.org>
945 * execute.c(match_an_address_p,process_files),
946 compile.c(compile_program): back out the "zero-address"
947 changes of 1998-09-27. It was a neat idea, but there are
948 too many dark corners which don't work well. The
949 special code for handling line ranges starting at
950 address zero (from 1998-08-31) are still there though:
951 this seems to work fine with no surprises.
953 Sat Oct 31 22:18:59 PST 1998 Ken Pizzini <ken@gnu.org>
955 * sed/sed.c, sed/sed.h, sed/execute.c: added new
956 `lcmd_out_line_len' variable. (Idea suggested by
957 Carlos J. G. Duarte <l38076@alfa.ist.utl.pt>.)
958 Also added ATOI macro (which uses strtoul() if available,
959 with fall-back to atoi()).
960 * sed/sed.c(main): attempt to use COLS environment variable
961 to set a reasonable `lcmd_out_line_len'; added -l/--line-length
962 command-line options to set the new `lcmd_out_line_len' flag.
963 * sed/sed.c(usage): documented new -l/--line-length options.
964 * sed/execute.c(do_list): use `lcmd_out_line_len' variable
965 instead of `LCMD_OUT_LINE_LEN'.
966 * sed/execute.c: deleted now obsolete LCMD_OUT_LINE_LEN define.
967 * configure.in: added strtoul to the AC_CHECK_FUNCS call.
969 Sat Oct 31 21:37:17 PST 1998 Ken Pizzini <ken@gnu.org>
971 * sed/sed.c, sed/sed.h, sed/execute.c: added new `force_unbuffered'
972 flag. (Idea suggested by Frank Strauss <strauss@escape.de>.)
973 * sed/sed.c(main): added -u/--unbuffered command-line options
974 to set the new `force_unbuffered' flag.
975 * sed/sed.c(usage): documented new -u/--unbuffered options.
976 * sed/execute.c: changed the name of the `is_tty' flag in struct
977 input to a more generic `no_buffering'; also removed HAVE_ISATTY
978 conditional on this member.
979 * sed/execute.c(slow_getline): removed HAVE_ISATTY conditonal
980 compilation of this function.
981 * sed/execute.c(output_line): if force_unbuffered is set,
982 then force a fflush() even if writing to stdout.
983 * sed/execute.c(open_next_file): added handling of the
984 new `force_unbuffered' flag so that slow_getline()
985 will always be used for input.
986 * sed/execute.c(read_file_line): changed the (conditionally
987 compiled) test of `input->is_tty' to (unconditionally)
988 use the new spelling `input->no_buffering'.
990 Thu Oct 15 12:08:09 PDT 1998 Ken Pizzini <ken@gnu.org>
992 * configure.in: deleted AC_ARG_PROGRAM call; this is already
993 done for us by AM_INIT_AUTOMAKE, and we were winding up
994 with a doubled-transform.
996 Sun Sep 27 01:42:42 PDT 1998 Ken Pizzini <ken@gnu.org>
998 * compile.c(compile_program): remove special-case code for matching
999 address range with a `0' beginning.
1001 * compile.c(compile_address): change default addr_number to
1002 be a pragmatically impossible countT value, instead of zero.
1004 * execute.c: spell macro REGNEXEC() unconditionally instead of
1005 playing with conditional definition of regnexec() macro.
1007 * execute.c(match_an_address_p): added third argument (and changed
1008 callers in match_address_p). Added special code to ignore
1009 non-numeric matches when processing "line zero".
1011 * execute.c(process_files): added a "line zero" pass through the
1014 Sun Sep 27 00:20:53 PDT 1998 Ken Pizzini <ken@gnu.org>
1016 * compile.c(xofa,normalize_text): new functions.
1017 * compile.c(compile_regex): cache last_compiled_re (with its
1018 associated flags); add POSIXLY_CORRECT behavior for empty RE.
1019 Make use of the new normalize_text() function.
1020 * compile.c(setup_replacement): Make use of the new normalize_text()
1023 Sat Sep 26 22:59:13 PDT 1998 Ken Pizzini <ken@gnu.org>
1025 * lib/regex-gnu.h: added missing prototype for regncomp().
1027 Mon Sep 14 20:47:23 PDT 1998 Ken Pizzini <ken@gnu.org>
1029 * sed/sed.c(main): use EXIT_SUCCESS instead of 0, in case
1030 we are built on a system (such as VMS) where EXIT_SUCCESS
1033 Wed Sep 9 22:17:28 PDT 1998 Ken Pizzini <ken@gnu.org>
1035 * sed/Makefile.am: added -I../intl the INCLUDES line; if we are
1036 building in a directory outside the source tree and the system
1037 we are building on does not have a <libintl.h> header, then
1038 the build was failing, because libintl.h is a build-time
1039 constructed source file.
1041 * configure.in: tweaked version to be 3.02b.
1043 Wed Sep 9 19:28:14 PDT 1998 Ken Pizzini <ken@gnu.org>
1045 *** Version 3.02a released
1047 * sed/compile.c(mark_subst_opts,read_label,compile_program):
1048 wherever we accept a ; as a command terminator, also allow a } or
1049 a # to appear. (This allows for less cluttered-looking scripts,
1050 such as: sed '/foo/{x;G}' (instead of: sed '/foo/{x;G;}').)
1052 Wed Sep 9 18:17:07 PDT 1998 Ken Pizzini <ken@gnu.org>
1054 * sed/compile.c(compile_regex): use regncomp() instead
1055 of regcomp(), so that a script with NULs in its REs
1056 will work in the expected manner.
1058 * sed/compile.c(ADDNUL,REGNCOMP): added support macros
1061 * lib/regex.c(regncomp,regcomp): added regncomp() and
1062 made regcomp() a simple wrapper function.
1064 Mon Aug 31 21:48:30 PDT 1998 Ken Pizzini <ken@gnu.org>
1066 * sed/sed.c(compile_program): if the first address of
1067 a range is the number 0 (or a 0~N sequence), start
1068 out in the "a1_matched" state. This allows one
1069 to match an initial chunk of a file without undue
1070 convolutions for handling the case where the match
1071 for the end of the sequence happens to be the first
1074 Sun Aug 16 03:34:25 PDT 1998 Ken Pizzini <ken@gnu.org>
1076 * sed/compile.c(snarf_char_class,match_slash): simplify
1077 handling of "premature newline" error. Also, get the
1078 line number right in the error message if we encounter
1079 a "premature newline" during char-class snarfing.
1081 Sun Aug 16 02:59:20 PDT 1998 Ken Pizzini <ken@gnu.org>
1083 * sed/compile.c: added N_() markers and corresponding gettext()
1086 * Merged in i18n contribution from Erick Branderhorst
1087 <Erick.Branderhorst@asml.nl>. His ChangeLog entry
1088 for the changes I've incorporated so far:
1090 1998-07-24 Erick Branderhorst <Erick.Branderhorst@asml.nl>
1091 * configure.in (ALL_LINGUAS, AM_GNU_GETTEXT): nl
1092 * sed/{sed.h,utils.c}: #include <libintl.h> #define _(String)
1094 * sed/sed.c: #include <locale.h>
1095 * po/POTFILES.in: sed/{compile,execute,sed,utils}.c
1097 * acconfig.h: #undef LOCALEDIR ENABLE_NLS HAVE_CATGETS
1098 HAVE_GETTEXT HAVE_LC_MESSAGES HAVE_STPCPY
1100 Fri Aug 14 13:52:57 PDT 1998 Ken Pizzini <ken@gnu.org>
1102 * Merged code from 3.02 with a branched development
1103 tree from late May; the following (out-of-order)
1104 changelog entry is from the branched tree.
1106 Sat May 30 12:23:16 PDT 1998 Ken Pizzini <ken@gnu.org>
1108 * sed/compile.c, sed/execute.c: added (conditional on NOLEAKS macro)
1109 code to free all dynamically allocated memory.
1111 * sed/sed.c, sed/compile.c, sed/execute.c: much shuffling
1112 of code --- ordered functions such that no forward
1113 declarations are necessary, and placed all static prototypes
1114 immediately before the actual function definition.
1115 This accomplished two things: first, I find the new ordering
1116 a more natural way to read the code than the previous
1117 ordering, and second, the new ordering give the compiler
1118 a better opportunity to discover inlining possibilities.
1119 (The odd "prototype declaration+old-style definition"
1120 style is used because I feel it is the least ugly way
1121 of supporting K&R1 C while still getting the benefit of
1122 prototypes when they are available.)
1124 * sed/basicdefs.h: added MEMCPY() macro to hide the VCAST()s
1125 that ought to be used with memcpy().
1127 * sed/execute.c: Change calls to memcpy() to go through the
1128 new MEMCPY() macro. Various prototypes: elide variable name
1129 if it does not add any human-useful documentary information
1132 * sed/sed.c(main): Updated calls to compile_string() to add third
1133 (length) argument. Changed call to obsolete close_all_files()
1134 to a call to the new finish_program().
1136 * sed/sed.c(map_file): Attempt to clean-up how "size" gets
1137 cast and tested; remove spurious S_ISREG test (just let
1138 mmap() fail if it doesn't support the underlying file type).
1140 * sed/sed.c: Deleted old RX library stub declarations.
1142 * sed/sed.c(map_file,unmap_file): added VCAST()s to the
1143 mmap()/munmap() calls.
1145 * sed/utils.c(ck_fclose): added support for ANSI C
1146 functionality where passing a NULL argument means
1147 to fclose() _all_ open streams. (Well, almost.
1148 Only closes streams which were previously ck_fopen()ed,
1149 as I don't care to figure out how to autoconf-detect
1150 whether fclose(NULL) is properly supported on a given
1153 * sed/sed.h: Renamed `struct text_buf' member `text_len'
1154 to `text_length'. Abstracted out `enum addr_types'
1155 from `struct addr'; added new enum types num2,step,step_mod;
1156 renamed mod to num_mod. De-unionized the regex,number,
1157 {modulo-offset/step} components of `struct addr', in
1158 anticipation of new features. Changed type of `a2' member
1159 of `struct sed_cmd': now a pointer to save space.
1160 Abstracted out `struct replacement' from `struct subst'.
1161 Cleaned up declaration of `x' union of `struct addr'.
1162 Fixed prototype for compile_string(). Replaced prototype
1163 for old close_all_files() with one for new finish_program().
1165 * sed/sed.h, sed/compile.c, sed/execute.c: changed to
1166 simplify the data structures used for branches and
1167 command blocks: simplified `struct vector'; made
1168 `struct label' local to compile.c; `struct sed_cmd'
1169 was modified to support a simpler design for branches
1172 * sed/execute.c: Conditionally added ADDNUL() macro so that
1173 the function call overhead is only incurred if nul_append()
1174 _must_ be called. Made some commentary edits, including
1176 * sed/execute.c(resize_line): changed semantics of "len" argument
1177 from "additional length" to "target length"; made
1178 INITIAL_BUFFER_SIZE a minimum allocation length.
1179 * sed/execute.c(str_append): adjusted to new resize_line()
1181 * sed/execute.c(line_copy): use FREE()+MALLOC() instead of
1182 REALLOC() to avoid unnecessary copying of old text; add the
1183 "try doubling first" allocation heuristic (just like
1184 resize_line() does).
1185 * sed/execute.c(line_exchange): new function.
1186 * sed/execute.c(nul_append): make whole function (not just its
1187 body) conditional on HAVE_REGNEXEC macro; adjust to new
1188 resize_line() semantics.
1189 * sed/execute.c(read_mem_line): use str_append() instead if
1190 custom in-line code; compensate for new default of
1191 "line.chomped = 0" in read_pattern_space() by setting
1192 "line.chomped = 1" where appropriate.
1193 * sed/execute.c(read_file_line): use different trigger to
1194 determine that "buffer" is uninitialized, and do a full
1195 initialization if required; use str_append() instead of custom
1196 in-line code in two places; compensate for new default of
1197 "line.chomped = 0" in read_pattern_space() by setting
1198 "line.chomped = 1" where appropriate.
1199 * sed/execute.c(output_line): don't bother calling ck_fwrite()
1201 * sed/execute.c(release_append_queue): new function.
1202 * sed/execute.c(dump_append_queue): use release_append_queue()
1203 instead of in-line equivalent.
1204 * sed/execute.c(read_pattern_space): conditionalize call to
1205 dump_append_queue() for alleged performance reasons; changed
1206 default "line.chomped" value to more common "1", and added an
1207 assignment of "0" where this made a difference.
1208 * sed/execute.c(match_an_address_p): deleted "is_addr2_p"
1209 argument; reorder cases to match order in enum declaration; add
1210 cases for new "addr_is_num2", "addr_is_step", and
1211 "addr_is_step_mod" address types; alter nul_append() call to be
1212 through ADDNUL() macro; fix to new struct member and enum
1213 spellings in (formerly addr_is_mod); addr_is_num_mod case.
1214 * sed/execute.c(match_address_p): remove oblsolete third argument
1215 to calls to match_address_p(); alter references to sed_cmd
1216 member a2 to reflect new pointer status; add new support for
1217 a2->addr_type addr_is_step and addr_is_step_mod cases.
1218 * sed/execute.c(do_subst): add NOLEAKS support logic; use
1219 ADDNUL() wrapper to nul_append(); simplify replacement
1220 expansion by using the new "struct replacement" data structure;
1221 use line_exchange() function instead of custom in-line code.
1222 * sed/execute.c(process_files): added NOLEAKS code.
1223 * sed/execute.c(execute_program): updated implementations
1224 of the `{', `}', `:', `b', and `t' commands; modified
1225 `c' command gratuituosly; fixed potential memory
1226 overrun in `D' command. Simplified how nonstandard
1227 `loop increments' work. Use line_exchange() instead of
1228 custom in-line code in 'x' case.
1229 * sed/execute.c[EXPERIMENTAL_DASH_N_OPTIMIZATION conditional
1230 code]: various modifications intended to keep this
1231 code in sync with the new changes, but the code still
1232 retains its previous bugs.
1234 * sed/compile.c: use "exit(EXIT_FAILURE) instead of "exit(1)",
1235 just in case we get compiled under VMS.
1236 * sed/compile.c: Change type of prog_info.base to decrease needs
1237 for casting; then elimiated the casts in question ;-).
1238 * sed/compile.c: Added struct sed_label (moved from sed.h, then
1240 * sed/compile.c: Removed "readit_p" flag from struct fp_list.
1241 * sed/compile.c: Added module-global "blocks" variable.
1242 * sed/compile.c: Extracted more error-message constant strings
1244 * sed/compile.c(check_final_program): updated to
1245 reflect new data structures and use new fucntions.
1246 Added call to compile_regex() to release unneeded
1248 * sed/compile.c: deleted obsolete new_vector() function;
1249 abstracted new read_label() function; abstracted new
1250 release_label() function; added new `blocks' module-static
1252 * sed/compile.c(compile_program): updated implementations
1253 of the `{', `}', `:', `b', and `t' commands; modified
1254 initialization from NULL vector.
1255 * sed/compile.c(compile_regex): added mechanism to
1256 release memory consumed by the cached `last' RE.
1257 * sed/compile.c(setup_jump,setup_label): updated
1258 name (from setup_jump to setup_label) and prototype;
1259 changed body to reflect data structure changes.
1260 * sed/compile.c: Add OPEN_BRACE and CLOSE_BRACE macros for better
1261 "vi" editing behavior.
1262 * sed/compile.c(compile_filename,read_filename,get_writefile):
1263 Replaced function compile_filename() with more orthogonal functions
1264 read_filename(), get_writefile().
1265 * sed/compile.c(compile_regex): Added ability to free the remembered
1266 "last RE" in compile_regex (for benifit of "NOLEAKS" code).
1267 * Made adjustments dictated by the change to struct sed_cmd which made
1268 the a2 member a pointer-to-addr instead of an addr.
1269 * sed/compile.c(setup_jump,read_label,setup_label,release_label):
1270 Added functions read_label(), setup_label(), release_label(); deleted
1271 function setup_jump().
1272 * sed/compile.c(new_replacement,setup_replacement,release_replacement):
1274 * sed/compile.c: Adjusted to new spelling of text_buf member
1275 ("text_length" instead of "text_len").
1276 * sed/compile.c(new_vector): deleted function. (Due to new handling
1277 of blocks, only one instance remained, and that one was just as
1279 * sed/compile.c(compile_string): Added third argument; it now
1280 takes a counted string instead of a NUL-terminated string.
1281 * sed/compile.c(compile_file): added variable "map_base" to
1282 compensate for new type of prog_info.base.
1283 * sed/compile.c(check_final_program): reflect new style of
1284 handling blocks and struct sed_label.
1285 * sed/compile.c(close_all_files,finish_program): replaced function
1286 close_all_files() with more generic finish_program().
1287 * sed/compile.c(read_text): added new feature: if first non-blank
1288 character after the {a,i,c} command character is not "\", then
1289 use the trailing text on that line as the (first) line of text.
1290 Also added code conditional on NO_INPUT_INDENT to support the
1291 "feature" of stripping leading blanks from each input line; I
1292 do not read POSIX as permitting this behavior, nor do I think
1293 it is a good idea, so it is disabled by default, but some have
1294 argued that this blank-stripping is the "correct" behavior, so
1295 I offer them the option of building their sed that way.
1296 * sed/compile.c(compile_address): added xxx,+n and xxx,~n addressing;
1298 * sed/compile.c(compile_program): added BAD_PLUS error detection;
1299 adjusted to new cur_cmd->a2 pointer status; added addr_is_num2
1300 detection; deleted pointless "a2->addr_number < a1.addr_number"
1301 check (addr_is_num2 semantics handle this just fine); updated
1302 code for '{', '}', ':', 'b', and 't' to reflect new design
1303 of branch handling, including making use of new functions
1304 related to the new design); added support for feature already
1305 mentioned in read_text() where {a,i,c} commands are able to have
1306 their text start on the same line as the command; changed some
1307 error messages (hopefully for the better); localized variables
1308 specific to individual commands (particularly 's' and 'y');
1309 made use of new setup_replacement() function in 's' command.
1311 Mon Aug 10 19:58:49 PDT 1998 Ken Pizzini <ken@gnu.org>
1313 * doc/sed.texi, doc/sed.1: sedtut10.txt is apparently dead.
1314 Deleted references to it and added a pointer to
1315 http://seders.icheme.org/tutorials/. (Pointed out by
1316 Joerg Heitkoetter <joerg@de.uu.net>.)
1318 Sat Aug 8 18:11:57 PDT 1998 Ken Pizzini <ken@gnu.org>
1320 * djgpp/config.btm: per request by Michel de Ruiter
1321 <mdruiter@cs.vu.nl>, added "%1" to "%9" parameters.
1323 Mon Aug 3 11:44:55 PDT 1998 Ken Pizzini <ken@gnu.org>
1325 * doc/sed.texi: fix a couple of typos. (Submitted by
1326 Alan Modra <alan@spri.levels.unisa.edu.au>.)
1328 Sat Aug 01 17:49:06 PDT 1998 Ken Pizzini <ken@gnu.org>
1330 *** Version 3.02 released
1332 * configure.in: Because of code change in 3.01a, bump the
1333 minor revision number for the release (now 3.02).
1335 Sun Jul 26 16:07:55 PDT 1998 Ken Pizzini <ken@gnu.org>
1337 *** Version 3.01a released
1339 * sed/compile.c(snarf_char_class): the POSIX char-class
1340 recognition loop forgot to update its concept of "prev"
1341 as the loop progressed.
1343 * testsuite/Makefile.am: The dependency of version.good
1344 on [testsuite/]Makefile introduced in the previous
1345 release was botched -- it referred to "Makefile"
1346 as "$(srcdir)/Makefile, which of course doesn't work
1347 if you aren't building in the source tree.
1349 * djgpp/Makefile.am: add forgotten "config.btm" EXTRA_DIST
1352 * configure.in: update version.
1354 Tue Jul 21 06:04:42 PDT 1998 Ken Pizzini <ken@gnu.org>
1356 *** Version 3.01 released
1358 * configure.in: mark as release version!
1360 * Makefile.am: add BUGS and THANKS to the EXTRA_DIST target.
1362 * testsuite/Makefile.am: add dependency of version.good
1363 on [testsuite/]Makefile.
1365 Mon Jul 20 12:38:10 PDT 1998 Ken Pizzini <ken@gnu.org>
1367 * djgpp/config.btm: New file to support the 4DOS alternative
1368 to command.com. (Sumitted by Eli Zaretskii on behalf of
1369 an anonymous 4DOS user.)
1371 Fri Jul 17 00:36:34 PDT 1998 Ken Pizzini <ken@gnu.org>
1373 *** Version 3.01-beta18 released
1375 * djgpp/config.sed: my "tweak" in beta17 was too
1376 hastily considered. Back it out.
1378 * configure.in: update to beta18.
1380 Wed Jul 15 01:02:15 PDT 1998 Ken Pizzini <ken@gnu.org>
1382 *** Version 3.01-beta17 released
1384 * djgpp/config.sed: tweak/simplify s,,, commands at end.
1386 * configure.in: update to beta17.
1388 1998-07-14 Eli Zaretskii <eliz@is.elta.co.il>
1390 * djgpp/config.sed: Edit all the occurences of = in the context of
1391 --option=value, including in the help messages, into
1392 --option:value, but leave DOS-style d:/foo/bar file names intact.
1394 * djgpp/config.bat: Use --srcdir:foo instead of --srcdir=foo.
1396 * testsuite/Makefile.am (help, version): Remove temporary files
1397 explicitly, don't use shell wildcards, so it works under DOS 8+3
1400 Thu Jul 9 13:06:00 PDT 1998 16:51:43 PDT 1998 Ken Pizzini <ken@gnu.org>
1402 *** Version 3.01-beta16 released
1404 * djgpp/config.sed: tweak the configure script to use :
1405 instead of = for --with-foo=bar option parsing, to
1406 work around problems with how command.com handles =s.
1408 Wed Jul 8 16:51:43 PDT 1998 Ken Pizzini <ken@gnu.org>
1410 * djgpp/config.bat: correct inappropriate behavior that I
1411 introduced in the beta13 changes (if first argument is
1412 a directory, it needs to be handled as the --srcdir).
1414 * testsuite/version.gin, testsuite/version.good, testsuite/Makefile.am:
1415 Add target to automake to automatically update version.good
1416 from (new file) version.gin, instead of hand-editing the version
1417 number each release.
1419 * testsuite/Makefile.am: miscellaneous gratuitious tweakage --
1420 mainly adding $(RM) commands just because I didn't like
1421 leaving the tmp* files from successful runs laying about.
1422 Also some editorial comments.
1424 * configure.in: update to beta16. Added and commented out
1425 experiment with AC_OUTPUT() for testsuite/version.good.
1426 Added code to properly handle bare (without =xxx)
1427 "--with-regex" option.
1429 Sun Jul 5 21:02:16 PDT 1998 Ken Pizzini <ken@gnu.org>
1431 *** Version 3.01-beta15 released
1433 * sed/utils.c(ck_fflush), sed/utils.h, sed/execute.c(output_line):
1434 add and use new ck_fflush() function.
1436 Sun Jul 5 15:23:47 PDT 1998 Ken Pizzini <ken@gnu.org>
1438 * sed/compile.c(bad_prog): add more detail to error
1439 messages about -e strings.
1441 Sun Jul 5 14:29:45 PDT 1998 Ken Pizzini <ken@gnu.org>
1443 * sed/compile.c(mark_subst_opts), sed/execute.c(do_subst):
1444 Define better semantics for interaction of the `g' flag
1445 with a numeric flag to the s/// command. It used to
1446 be that the `g' command siezed control; now the first
1447 (number-1) matches are skipped and then `g' gets control
1448 after that. (It is not clear whether this is a feature
1449 sneaking in during late beta, or a bug fix; the changes
1450 involved were trivial, so I decided to treat it as a bug
1453 * configure.in, testsuite/version.good: update to beta15.
1455 Sat Jul 4 09:54:45 PDT 1998 Ken Pizzini <ken@gnu.org>
1457 *** Version 3.01-beta14 released
1459 * sed/basicdefs.h, sed/compile.c, sed/execute.c:
1460 per report by "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>,
1461 copied the ISXXX macros from lib/regex.c so that
1462 silly machines which require isascii() to be true
1463 before the other isXXX() macros are valid will
1466 * configure.in, testsuite/version.good: update to beta14.
1468 Thu Jul 2 23:46:13 PDT 1998 Ken Pizzini <ken@gnu.org>
1470 *** Version 3.01-beta13 released
1472 * configure.in, acconfig.h: set USE_REGEX_GNU_H symbol if we
1473 are going to be using lib/regex.c.
1475 * lib/Makefile.am, lib/regex.h, lib/regex-gnu.h, lib/regex.c:
1476 rename lib/regex.h to lib/regex-gnu.h, so that those who
1477 choose to use a different regex implementation will not
1478 pick-up lib/regex.h when doing "#include <regex.h>".
1480 * sed/regex-sed.h, sed/Makefile.am, sed/compile.c, sed/execute.c,
1481 sed/sed.c: create sed/regex-sed.h which acts as a switch
1482 to choose either lib/regex.h or the user-supplied <regex.h>,
1483 depending on the value passed to configure's --with-regex=
1486 Thu Jul 2 17:22:31 PDT 1998 Ken Pizzini <ken@gnu.org>
1488 * configure.in: if an alternative --with-regex= is given,
1489 do an AC_CHECK_FUNCS(regnexec regexec) to ensure that
1490 at least one of these functions is available. Also,
1491 parallel changes for the default case.
1493 * sed/execute.c, acconfig.h: retire use of the WITH_REGNEXEC
1494 test macro in favor of HAVE_REGNEXEC test macro created
1497 * djgpp/config.bat: Play games to handle "install-sh",
1498 DOS filename restrictions, GNU makefile default rules,
1499 and getting a correct run of "configure" (contributed
1500 by Eli Zaretskii <eliz@is.elta.co.il>).
1502 * djgpp/Makefile.am, testsuite/Makefile.am, testsuite/Makefile.in,
1503 Makefile.am, configure.in: Various automake targets
1504 (such as distcheck) failed with old configuration.
1505 The simplest solution was to just add these .am
1506 files. (The testsuite/Makefile.in was just renamed to
1507 testsuite/Makefile.am, then various redundant defines and
1508 targets were deleted.) (Reported by Erick Branderhorst
1509 <Erick.Branderhorst@asml.nl>.)
1511 * testsuite/dc.good, testsuite/dc.inp: per suggestion from
1512 Greg Ubben <gsu@romulus.ncsc.mil>, use base 16 output to
1513 exercise even more of the dc.sed script.
1515 * configure.in, testsuite/version.good: update to beta13.
1517 Sun Jun 28 16:21:02 PDT 1998 Ken Pizzini <ken@gnu.org>
1519 *** Version 3.01-beta12 released
1521 * doc/sed.texi: Avoid mixing @code and @samp markups together:
1522 they look ugly in Info. Use @url and @email instead of @example.
1523 Add indexes. (Basis of changes contributed by Eli Zaretskii.)
1525 * djgpp/*, Makefile.am: add support for the DJGPP compiler,
1526 contributed by Eli Zaretskii <eliz@is.elta.co.il>.
1528 * dc.sed, testsuite/Makefile.in, testsuite/dc.inp, testsuite/dc.good:
1529 added this remarkable script, written and contributed
1530 by Greg Ubben <gsu@romulus.ncsc.mil>, both as a work of
1531 art for general admiration, and also for use in regression
1534 * configure.in, lib/Makefile.am: add --with-regex=regexlib
1535 option, which overrides the use of lib/regex.c.
1537 * configure.in, testsuite/version.good: update to beta12.
1539 Fri Jun 12 16:41:48 PDT 1998 Ken Pizzini <ken@gnu.org>
1541 *** Version 3.01-beta11 released
1543 * sed/compile.c: add module-static variables first_script
1544 (for #n change below) and pending_text (for a/c/i change
1547 * sed/compile.c(compile_file), sed/compile.c(compile_program):
1548 Instead of having #n trigger the -n option in *any file*,
1549 have #n trigger the -n option only if they are the first
1550 two bytes of the first script or script-file.
1552 * sed/compile.c(compile_string), sed/compile.c(compile_file):
1553 clear the first_script variable at end of these functions.
1555 * sed/sed.h: tease out the struct text_buf declaration from
1556 struct sed_cmd, so that a pointer to such can be passed
1557 to new sed/compile.c(read_text) function.
1559 * sed/compile.c(compile_program), sed/compile.c(read_text):
1560 Tease out handling of text to a/c/i commands to new
1561 read_text() function. Handle (via aid of pending_text
1562 variable) texts which span more than one script/script-file
1563 option. In particular, restore the ability to have this
1564 work: sed -e '1i\' -e 'foo'
1566 * sed/compile.c(check_final_program): close off any dangling
1567 pending_text allocation.
1569 Thu Jun 11 11:17:46 PDT 1998 Ken Pizzini <ken@gnu.org>
1571 * sed/execute.c(do_subst): fixed two bugs: s/ */X/g was failing
1572 to match the final empty string after the end of the pattern
1573 space; and /^foo$/s/o/x/3p was printing, despite the failure
1576 Fri Jun 5 04:40:24 PDT 1998 Ken Pizzini <ken@gnu.org>
1578 * configure.in: change the AC_ARG_WITH(regnexec, ...)
1579 to be the more appropriate AC_ARG_ENABLE(regnexec, ...).
1581 * configure.in, testsuite/version.good: update to beta11.
1583 Fri Jun 5 00:54:25 PDT 1998 Ken Pizzini <ken@gnu.org>
1585 *** Version 3.01-beta10 released
1587 * sed/execute.c: forgot to P_() the prototype and
1588 old-style the declaration for bootstrap_memchr()!
1590 Thu Jun 4 18:42:30 PDT 1998 Ken Pizzini <ken@gnu.org>
1592 * sed/compile.c(snarf_char_class): added code to
1593 recognize \n or \<newline> sequence within a
1594 char-class as the newline character.
1596 Tue Jun 2 11:56:02 PDT 1998 Ken Pizzini <ken@gnu.org>
1598 * configure.in: added check for <sys/types.h> and
1599 a AC_ARG_WITH(regnexec,...) check, to simplify use
1600 of other regex libraries which have regexec() but
1601 not regnexec(), with the corresponding loss of
1602 functionality (regexps will not work right against
1603 input lines which contain NULs).
1605 * sed/execute.c: add nul_append() function, a #define
1606 for a regnexec() -> regexec() macro (conditional on
1607 the lack of the WITH_REGNEXEC symbol), and a couple
1608 of calls to nul_append() (in match_an_address_p()
1609 and do_subst()) to permit the use of the POSIX standard
1610 regexec() function call instead of the suggested
1613 * sed/compile.c, sed/execute.c, sed/sed.c: check for
1614 <sys/types.h> and include it (before "regex.h") if
1615 available. This makes it simpler to use the system's
1616 regex library instead of the one in lib/regex.c, should
1619 Tue Jun 2 08:41:05 PDT 1998 Ken Pizzini <ken@gnu.org>
1621 * sed/basicdefs.h: define VCAST macros to allow sed to
1622 compile on systems which predate the definition
1623 of "void *", and yet still get feedback about
1624 stupid programming errors from systems which *do*
1625 know about "void *"s. Also define MALLOC, REALLOC,
1626 MEMDUP, and FREE macros to keep under control the
1627 degree of code ugliness which would otherwise be
1628 introduced in making use of the VCAST macro.
1630 * sed/compile.c, sed/execute.c, sed/sed.c, sed/utils.c:
1631 pervasively use the new VCAST, MALLOC, REALLOC, MEMDUP,
1632 and FREE macros wherever appropriate.
1634 * sed/utils.c, sed/utils.h: correct type of first arguments
1635 to ck_fread() and ck_fwrite() to be [const] VOID *.
1637 * sed/basicdefs.h, sed/execute.c: protect against
1638 the rumored systems which stupidly #define __STDC__ 0.
1640 * testsuite/help.good, testsuite/Makefile.in: make
1641 the ``help'' test insensitive to the spelling of
1642 the executable's name. Also, enhanced `make clean'
1645 * doc/sed.texi, doc/sed.1: correct documentation of `q'
1648 * configure, testsuite/version.good: update to beta10.
1650 Sat May 30 17:28:00 PDT 1998 Ken Pizzini <ken@gnu.org>
1652 *** Version 3.01-beta9 released
1654 * Makefile.am: make testsuite a normal SUBDIR.
1656 * configure.in: discontinue using AC_ISC_POSIX --
1657 check for -lcposix library instead; added
1658 testsuite/Makefile to AC_OUTPUT list.
1660 * lib/memmove.c(memmove): fixed wrong sense used
1661 for HAVE_BCOPY test.
1663 * sed/execute.c: checked more specifically for a version
1664 of gcc which supports __attribute__ (i.e., >= 2.7).
1666 * testsuite/*: renamed files to fit 14 char limit.
1668 * testsuite/Makefile, testsuite/Makefile.in: Makefile
1669 renamed to Makefile.in and then modified so that
1670 "make -j check" from top directory will work.
1672 * testsuite/subwrite.sed, testsuite/writeout.sed: changed
1673 file name of the "w" command to be consistent with the
1674 new naming used in testsuite/Makefile.in.
1676 * doc/sed.1, doc/sed.texi: fixed some typos, formatting
1677 glitches, and poor wordings.
1679 Sat May 30 04:02:29 PDT 1998 Ken Pizzini <ken@gnu.org>
1681 * configure.in: specify that config.h is to be derived
1682 from config_h.in in order to avoid the braindead
1683 DOS filesystem limitations.
1685 Fri May 29 21:56:30 PDT 1998 Ken Pizzini <ken@gnu.org>
1687 * sed/compile.c(compile_address), doc/sed.texi: gave
1688 a better definition to the meaning of N~0 address
1689 forms -- N~M addresses now mean that lines match
1690 when there exists a non-negative x such that
1693 Fri May 29 12:07:38 PDT 1998 Ken Pizzini <ken@gnu.org>
1695 * sed/compile.c(compile_address),
1696 sed/execute.c(match_an_address_p): update semantics of
1697 N~M address form: now N is the first line which will
1698 match and M is the step between succeeding matches.
1699 If N<M this works out to the same as before, but the
1700 new behavior for N>=M seems more useful.
1702 * doc/sed.1, doc/sed.texi: update documentation of N~M
1703 address form; added "Other Resources" node to sed.texi;
1704 minor formatting changes to some items in sed.1 with
1705 an eye to improving clarity.
1707 * configure.in, testsuite/version.good: update to beta9.
1709 Sat May 23 20:04:31 HST 1998 Ken Pizzini <ken@gnu.org>
1711 *** Version 3.01-beta8 released
1713 * sed/compile.c(compile_regex): forgot to make last_re be
1714 a *copy* of the buffered text in today's earlier fix.
1716 * sed/execute.c(read_file_line): EOF check was wrong --
1717 it forgot to allow for the possibility that we were
1718 appending to the end of the ``line'' (instead of merely
1719 reading a fresh line).
1721 Sat May 23 18:07:18 HST 1998 Ken Pizzini <ken@gnu.org>
1723 * sed/compile.c(compile_regex): don't track compiled version
1724 of regex -- the modifiers may change. Track the regex
1725 source instead. (For "last regex" (aka //) notation.)
1727 * configure.in, testsuite/version.good: update to beta8.
1729 Sat May 23 16:07:09 HST 1998 Ken Pizzini <ken@gnu.org>
1731 *** Version 3.01-beta7 released
1733 * sed/execute.c: #undef'd EXPERIMENTAL_DASH_N_OPTIMIZATION
1734 because its code is buggy.
1736 Tue May 19 17:03:52 HST 1998 Ken Pizzini <ken@gnu.org>
1738 * sed/sed.c: label rx library code as such with #ifdefs
1739 (instead of just #if 0).
1741 * sed/compile.c(compile_program): make incremental
1742 improvement to the "Unknown command" error message.
1744 Sat May 16 23:16:26 HST 1998 Ken Pizzini <ken@gnu.org>
1746 * testsuite/Makefile: simplify: get rid of automatic run
1747 against system's sed; don't time by default; allow for
1748 alternative comparison command.
1750 * configure.in, testsuite/version.good: update to beta7.
1752 Wed May 13 21:44:28 PDT 1998 Ken Pizzini <ken@gnu.org>
1754 *** Version 3.01-beta6 released
1756 * lib/Makefile.am: fix spelling of libsed_a_LIBADD in
1757 libsed_a_DEPENDENCIES.
1759 * configure.in, testsuite/version.good: update to beta6.
1761 Wed May 13 14:38:08 PDT 1998 Ken Pizzini <ken@gnu.org>
1763 *** Version 3.01-beta5 released
1765 * sed/execute.c(do_subst): added not_bol_p variable to track when
1766 we have iterated past the beginning of the pattern.
1767 [Thanks to Jim Meyering <meyering@ascend.com> for the bug report.]
1769 Wed May 13 13:54:04 PDT 1998 Ken Pizzini <ken@gnu.org>
1771 * sed/execute.c(bootstrap_memchr): new function. When
1772 bootstrapping we don't know if we are on a 64-bit machine,
1773 so lib/memchr.c breaks. Supply this (slow) implementation
1774 just to get us bootstrapped.
1776 * bootstrap.sh: add a #define BOOTSTRAP symbol; add -I.
1777 for emphasis for the compiles in sed/; be explicit
1778 about what files we're bothering to compile.
1780 * configure.in, testsuite/version.good: update version
1783 Wed May 13 06:39:06 PDT 1998 Ken Pizzini <ken@gnu.org>
1785 *** Version 3.01-beta4 released
1787 * rename writeout.good? to wrtout?.good and subwrite.good? to
1788 subwrt?.good to comply with DOS 8+3 file name restrictions.
1789 [Eli Zaretskii <eliz@is.elta.co.il> suggested this to
1790 simplify DJGPP ports, and it was easy.]
1792 * testsuite/Makefile: reflect above name changes.
1794 Wed May 12 21:09:32 PDT 1998 Ken Pizzini <ken@gnu.org>
1796 * sed/sed.c(usage): fix non-portable omission of \n\ at end of
1797 lines within long string.
1799 * sed/sed.c(main): remove spurious argument to fprintf() in the
1802 * sed/execute.c(line_append): embed newline between the two
1803 text fragments unconditionally.
1805 * sed/execute.c(do_subst): change structure assignment to memcpy()
1806 (for portability reasons).
1808 * README.bootstrap: suggest using -w option.
1810 Tue May 12 10:02:37 PDT 1998 Ken Pizzini <ken@gnu.org>
1812 * configure.in: use AC_REPLACE_FUNCS where appropriate.
1814 * lib/Makefile.am: updated to reflect AC_REPLACE_FUNCS change in
1817 * lib/memchr.c lib/memcmp.c: revert to standard GNU versions.
1819 * lib/alloca.c: added this missing file.
1821 * testsuite/version.good: updated for new version identifier.
1823 Mon May 11 18:50:56 PDT 1998 Ken Pizzini <ken@gnu.org>
1825 *** Version 3.01-beta3 released
1827 * sed/Makefile.am: fix INCLUDES to work right with VPATH.
1828 [Thanks to Jim Meyering <meyering@ascend.com> for the bug report.]
1830 * sed/sed.c(usage): make --help output more user-friendly?
1832 * sed/execute.c(execute_program): fix bug in 'x' command introduced
1833 in the alleged portability fix of May 9.
1835 * configure.in: update version to 3.01-beta3.
1837 * testsuite/version.good, testsuite/help.good: freshen with
1840 Sat May 9 22:35:45 PDT 1998 Ken Pizzini <ken@gnu.org>
1842 *** Version 3.01-beta2 released
1844 * sed/sed.c: add #include <sys/types.h> in HAVE_MMAP
1845 block (needed on some machines).
1847 * lib/memmove.c: #include <memory.h>, if HAVE_MEMORY_H.
1849 Sat May 9 21:29:00 PDT 1998 Ken Pizzini <ken@gnu.org>
1851 * configure.in: remove dangling references to rx library;
1852 added HEADER and FUNC checks for items used by source in
1855 * lib/ansidecl.h, lib/memcopy.h, lib/pagecopy.h, lib/string.h
1856 lib/memcpy.c, lib/memmove.c: deletes these files. There
1857 are still pieces of glibc missing to support these, and
1858 it isn't worth the headache right now.
1860 * lib/memmove.c: de novo, simpler version. Uses bcopy()
1861 if available, and slow-but-simple code if not.
1863 * lib/Makefile.am: remove references to deleted files.
1864 Added forgotten reference to memcpy.c. Re-ordered
1865 SOURCE entries to reflect dependencies for systems
1868 * sed/basicdefs.h: updated to reflect above changes to lib/,
1869 and experience with non-STDC compilers.
1871 * lib/regex.c: made regerror() function publicly visible.
1873 * lib/strerror.c: use old-style function declaration.
1875 * sed/compile.c, sed/execute.c, sed/sed.c, sed/utils.c,
1876 sed/sed.h, sed/utils.h: ensure that private definitions of
1877 some symbols do not cause problems when #include'ing system
1878 headers (mainly by re-ordering the #include directives).
1879 (This is particularly an issue for bootstrap.sh runs.)
1881 * sed/execute.c (execute_program): use memcpy() instead of
1882 structure assingment ('x' command), for portablility to
1885 * sed/execute.c (slow_getline): use old-style function
1886 declaration, with a P_ prototype.
1888 * sed/sed.c: change the type of the fallback MAP_FAILED
1889 definition to work on archaic systems. (Modern systems
1890 should be defining it themselves, so the change from
1891 void * shouldn't be a problem.)
1893 * bootstrap.sh, README.bootstrap: actual testing of bootstrap
1894 code revealed that I was too optimistic. Redesigned and
1895 replaced implementation.
1897 * testsuite/Makefile: ignore errors from reference-implementation
1898 seds that aren't up to snuff.
1900 * testsuite/help.good, testsuite/version.good: update to
1901 current version's output.
1903 Fri May 8 15:08:28 PDT 1998 Ken Pizzini <ken@gnu.org>
1905 *** Version 3.01-beta1 released
1907 * sed/sed.c (main, usage): once again tweak the --help and
1908 --version output to bettery comply with GNU coding standards.
1910 * testsuite/help.good, testsuite/version.good: update to
1911 reflect above change.
1913 * doc/sed.texi: fix "Invoking" node's spelling to comply
1916 Fri May 8 11:43:10 PDT 1998 Ken Pizzini <ken@gnu.org>
1918 * doc/sed.1, doc/Makefile.am: wrote (very basic) man page.
1920 Thu May 7 20:40:21 PDT 1998 Ken Pizzini <ken@gnu.org>
1922 * lib/Makefile.am, lib/memmove.c, lib/memchr.c, lib/regex.c,
1923 lib/memcpy.c, lib/regex.h, lib/memcopy.h, lib/string.h,
1924 lib/pagecopy.h, lib/ansidecl.h: grab yet-another-version
1925 from gnu.org for baseline and/or edit copyright boilerplate
1926 using official lgpl2gpl.sed script. Take care not to
1927 loose regnexec() interface or special conditional-compilation
1930 Wed May 6 23:35:12 PDT 1998 Ken Pizzini <ken@gnu.org>
1932 * lib/regex.c, lib/regex.h: take from grep-2.1 distribution,
1933 then trivially added the regnexec() interface.
1935 * sed/sed.c, sed/compile.c, sed/execute.c: made modifications
1936 to work with regex instead of rx.
1938 * rx/*: deleted directory; the code is just too slow.
1939 I think it will be easier to extend regex to fully
1940 support POSIX.2 than to tune rx to be reasonable.
1941 Even if this supposition is wrong, I'd rather make
1942 the 3.01 release with the slightly deficient regex.
1944 * Makefile.am lib/Makefile.am, sed/Makefile.am: made changes
1945 related to the substitution of regex for rx.
1947 * lib/Makefile.am, sed/Makefile.am: since regex is not a
1948 ``compatability'' module, changed name of library to
1951 * lib/memchr.c, lib/memcpy.c, lib/memmove.c: add conditional
1952 compilation code to leave zero-sized .o file if system
1953 already supports the implemented function.
1955 * testsuite/help.good, testsuite/version.good: brought
1956 up-to-date (once again).
1958 * NEWS, ANNOUNCE: changes to reflect this batch of changes.
1960 Wed May 6 18:40:47 PDT 1998 Ken Pizzini <ken@gnu.org>
1962 * sed/execute.c: discovered awful bug in '}' handling:
1963 it could read past the end of vec (because `n' was
1964 being decremented below zero)! Needed to "continue"
1967 Tue May 5 14:34:38 PDT 1998 Ken Pizzini <ken@gnu.org>
1969 * doc/sed.texi, doc/version.texi: wrote some rudimentary
1970 texinfo documentation.
1972 * ANNOUNCE, NEWS, README, README.rx, Makefile.am:
1973 more updates for the upcoming beta-release.
1975 * sed/compile.c, sed/execute.c, sed/sed.c, sed/utils.c,
1976 sed/sed.h, lib/strerror.c: update copyright notice text.
1978 Fri May 1 15:41:37 PDT 1998 Ken Pizzini <ken@gnu.org>
1980 * sed/execute.c (match_an_address_p, match_address_p): if
1981 the second element of an address range is a line number,
1982 and that line number is *less than* (or equal to) the
1983 current line number, we only match the one line (per
1984 POSIX.2, section 4.55.7.1). [Bug discovered as reported
1985 in the seders mailing list FAQ.]
1987 * AUTHORS, NEWS, acconfig.h, configure.in, doc/Makefile.am,
1988 lib/Makefile.am, sed/Makefile.am, lib/README,
1989 testsuite/help.good, testsuite/version.good:
1990 Updated in anticipation of the 3.01-beta1 release.
1991 Reorganized development source tree to make creation
1992 of a distribution simpler. Most notable changes were
1993 to the various Makefile.am files and configure.in, but
1994 some minor edits (such as deleting or changing #include
1995 directives) have been made in many other source files.
1997 * bootstrap.sh, README.bootstrap: created a mechanism for
1998 creating sed on a system which lacks a working sed.
2000 Thu Apr 16 23:52:11 PDT 1998 Ken Pizzini <ken@gnu.org>
2002 * sed.h, sed.c, execute.c, compile.c: did a spell-check on
2003 the comments; fixed several typos.
2005 Thu Apr 16 13:43:01 PDT 1998 Ken Pizzini <ken@gnu.org>
2007 * execute.c (do_subst): fixed bug where the "replaced" flag
2008 was being set to one inappropriately when at least one
2009 but fewer than sub->numb matches of the regexp were found.
2010 (Thanks to Simon Taylor <staylor@hermes.iaccess.com.au>
2011 for the bug report.)
2013 Wed Apr 15 11:35:31 PDT 1998 Ken Pizzini <ken@gnu.org>
2015 * sed.h, sed.c, compile.c, execute.c: having a concern that
2016 a cast was being done inappropriately, and realizing that
2017 there is no quick way to locate all casts in a program, I
2018 went through and marked all casts with a simple macro.
2019 Now it is a simple matter to locate the casts, and it is
2020 also a simple matter to turn of casts for a lint session
2021 (if it should be desired).
2023 Wed Apr 15 10:29:21 PDT 1998 Ken Pizzini <ken@gnu.org>
2025 * compile.c, sed.c: redo compile phase so that brace
2026 expressions can be spread across multiple files.
2028 printf '{' >a; printf 'l;d' >b; printf '}' >c
2029 sed -f a -f b -f c foo
2030 will now compile (and work), instead of complaining
2031 about an unmatched '{'. The mess created in compile.c
2032 allowed a little simplification to the command-line
2033 processing of "-e" options in sed.c.
2035 sed.h: added (opaque) err_info member to struct vector;
2036 added comments to the members of struct vector.
2038 Wed Apr 14 23:50:50 PDT 1998 Ken Pizzini <ken@gnu.org>
2040 * sed.h, sed.c, compile.c, execute.c: added types countT and
2041 flagT in order to clarify what various "int"s were doing.
2042 Also makes it easy to change the type used for counts
2043 (for example, to "unsigned long long") if desired, although
2044 there are still some gotchas (such as the printf() format
2045 for the '=' command).
2047 Tue Apr 14 17:34:54 PDT 1998 Ken Pizzini <ken@gnu.org>
2049 * execute.c (execute_program, process_files, count_branches,
2050 shrink_program): Added a first attempt at program optimization.
2051 We now can quit early if we are running with the "-n"
2052 and all of the commands are known to be valid only for
2053 lines less than the current line. Thus the "sed" in
2054 "foo | sed -n 1,2p" will print read three lines, printint
2055 the first two, and then quit, regardless of how much longer
2056 "foo" might run or output. This optimization does not buy
2057 much in most cases (it sometimes even costs a little),
2058 but when it does help it can help big. The code is
2059 all conditionally compiled based on the
2060 EXPERIMENTAL_DASH_N_OPTIMIZATION symbol being #defined,
2061 so it can be easily omitted if it causes problems.
2063 Tue Apr 14 12:25:06 PDT 1998 Ken Pizzini <ken@gnu.org>
2065 * execute.c (test_dollar_EOF, last_file_with_data_p):
2066 test_dollar_EOF() was incorrectly returning a false (0)
2067 when there were unprocessed files, none of which had any
2068 data (either unopenable or zero-length). Created
2069 last_file_with_data_p() to detect this situation, and
2070 modified test_dollar_EOF() to make use of it.
2072 Thu Apr 2 23:02:18 PST 1998 Ken Pizzini <ken@gnu.org>
2074 * compile.c (match_slash): match_slash() did not handle
2075 [.coll.], [=equiv=], and [:class:] sequences within a
2076 character class. Added snarf_char_class() [which is a
2077 remote derivative of parse_char_class() from GNU ed-0.2]
2078 to deal with the details, and altered match_slash()
2079 to make use of it. Also created the trivial
2080 add_then_next() to avoid clutter in snarf_char_class().
2082 Thu Apr 2 20:34:42 PST 1998 Ken Pizzini <ken@gnu.org>
2084 * execute.c, sed.c, sed.h: There was a severe bug in
2085 how the code handled "sed 5n a b" when "a" consists
2086 of exactly five lines -- it behaved like "sed 5q a b"!
2088 Rearranged where files get opened -- large scale
2089 changes primarily involving main(), process_files(),
2090 and read_pattern_space(), but also touching on several
2091 other parts of execute.c. The read_pattern_space()
2092 function became unwieldly and parts were split into
2093 open_next_file(), closedown(), read_always_fail(),
2094 read_mem_line(), and read_file_line(). The
2095 at_end_of_file_p() function became obsolete and was
2096 eliminated; test_dollar_EOF_p() was updated. A few
2097 global and module-static variables were elminated, and
2098 "struct line" was extended; comments were added to the
2099 "struct line" declartation to document some important
2102 I undertook the reorganization with dread, but I
2103 feel that the new organization is an improvement
2104 well beyond just fixing the bug that inspired it.
2106 Thu Apr 2 01:16:25 PST 1998 Ken Pizzini <ken@gnu.org>
2108 * execute.c (read_file_line, slow_getline): the fread()
2109 buffering code gives insufficient feedback to a user
2110 running sed with a tty input device, so I created
2111 slow_getline() for reading from a tty device.
2112 Additionally, EOF detection has been made a little more
2113 sensitive to avoid requiring multiple EOFs to be entered
2116 * configure.in: added isatty() check.
2118 Wed Apr 1 11:04:30 PST 1998 Ken Pizzini <ken@gnu.org>
2120 * configure.in (CPPFLAGS, LDFLAGS, LIBS):
2121 Set to appropriate values if large file support needs
2122 explicit enabling. Code fragment taken from a 1997-10-25
2123 patch to gawk by Paul Eggert <eggert@twinsun.com>
2125 Thu Aug 14 17:43:27 PDT 1997 Ken Pizzini <ken@gnu.org>
2127 * utils.c (ck_fclose): modified to ignore NULL parameter.
2129 Thu Aug 14 12:08:45 PDT 1997 Ken Pizzini <ken@gnu.org>
2131 * execute.c: tweaked execute_program() to eliminate
2132 gratuitous "goto" usage.
2134 Thu Aug 14 11:30:04 PDT 1997 Ken Pizzini <ken@gnu.org>
2136 * compile.c: added case-insensitive modifier ('I') to
2137 address and s/// regexps. The s/// case also accepts
2138 the more popular 'i' modifier. (The address regexp
2139 cannot use 'i' as a modifier, as that conflicts with
2140 the use of the 'i'nsert command.)
2142 Thu Aug 14 09:29:06 PDT 1997 Ken Pizzini <ken@gnu.org>
2144 * compile.c: abstracted out match_slash() from the s///, y///,
2145 and address-regexp special-case codes.
2147 * execute.c: made dump_append_queue() use ck_fread() instead
2148 of hand-rolled error checking.
2150 Mon Jul 28 10:50:41 PDT 1997 Ken Pizzini <ken@gnu.org>
2152 * sed.c, sed.h, execute.c: POSIX.2, section 4.55.7, says that
2153 a newline must end *every* output line. But I think that
2154 it is useful (when seding a binary file) to omit a trailing
2155 newline if the input lacks one. Thus the addition of
2156 POSIXLY_CORRECT behavior.
2158 * execute.c: however, when seding multiple files my feeling
2159 is that it makes sense to have each file but the last
2160 behave as-if it ended in a newline. Modified read_pattern_space()
2163 * utils.c: realized that add1_buffer(), for performance reasons,
2164 shouldn't be calling memcpy() (indirectly via add_buffer()),
2167 Sat Jul 26 23:08:28 PDT 1997 Ken Pizzini <ken@gnu.org>
2169 * execute.c: attempted to make read_pattern_space more
2170 efficient for the the non-mmap() case.
2172 * utils.c, utils.h, execute.c: new function ck_fread()
2175 Sat Jul 26 20:22:14 PDT 1997 Ken Pizzini <ken@gnu.org>
2177 * execute.c, compile.c, sed.c: abstracted the mmap()
2178 interface into map_file()/unmap_file() [sed.c], and
2179 changed the ad-hoc code in compile_file() [compile.c]
2180 and process_file() [execute.c] to make use of the new
2183 Sat Jul 26 19:45:46 PDT 1997 Ken Pizzini <ken@gnu.org>
2185 * execute.c, compile.c, configure.in: Check to see if mmap()
2186 is available; if so make use of it on regular files.
2188 * compile.c: compile_file() now closes the input file
2191 Sun Jul 20 23:57:02 PDT 1997 Ken Pizzini <ken@gnu.org>
2193 * compile.c: modified parsing to permit whitespace in more
2194 places where it makes sense;
2195 added backslash escaping to the y/// command, per POSIX.
2197 * execute.c: Merged append_pattern_space() into read_pattern_space();
2198 moved body of 's' command to new function do_subst();
2199 moved body of 'l' command to new function do_list();
2200 changed output of 'l' command to conform to POSIX.2;
2201 made line handling conform to POSIX; added output_line() function;
2202 redesigned append-space algorithm; added append_queue structure and
2203 the next_append_slot() and dump_append_queue() functions.
2205 * sed.h: moved the definition of what is now struct subst
2206 outside of the definition of struct sed_cmd.
2208 Sat Jul 19 16:29:09 PDT 1997 Ken Pizzini <ken@gnu.org>
2210 * sed.c, execute.c, sed.h, Makefile.am: Separated out the
2211 pieces dealing with executing the program from the top-level
2212 parameter parsing and control.
2214 Sat Jul 19 01:16:35 PDT 1997 Ken Pizzini <ken@gnu.org>
2216 * sed.c, compile.c, sed.h, Makefile.am: separate out the
2217 pieces dealing with compiling the program from the pieces
2218 dealing with interpreting the result.
2220 * compile.c: add functions in_nonblank() and in_integer(),
2221 and change interface to compile_address() with an eye
2222 to making code clearer.
2224 Fri Jul 18 13:35:50 PDT 1997 Ken Pizzini <ken@gnu.org>
2226 * utils.c: attempt at a quasi-unification of the
2227 STDC and traditional C approaches to panic().
2229 * sed.c: eliminate some gratuitous bit twiddling.
2230 (Using flag bits can be a useful technique, but
2231 this code is cleaner without them.)
2233 * sed.c: place mutually exclusive members of struct addr
2234 within a union, mainly to document the exclusivity;
2235 eliminate unused structure members from struct fp_list;
2236 eliminate unnecessary module-global variables;
2237 remove some #if 0 code that is too odd to keep;
2238 allegedly simplified the 'l' case of execute_program();
2239 allegedly simplified inchar();
2240 localized some static variables;
2241 renamed some variables to better document their purpose;
2242 removed some goto-s rendered obsolete by other changes.
2244 Thu Jul 17 15:30:44 PDT 1997 Ken Pizzini <ken@gnu.org>
2246 * utils.c, utils.h, sed.c: added and made use of
2249 * utils.c, utils.h, sed.c: changed all the *_buffer()
2250 functions to take/return an incomplete type
2251 "struct buffer *" instead of using VOID *.
2253 * utils.c, utils.h, sed.c: renamed "finish_buffer()"
2254 to "free_buffer()", on the premise that the new
2255 name better describes the function's purpose.
2257 Wed Jul 16 13:52:14 PDT 1997 Ken Pizzini <ken@gnu.org>
2259 * utils.c, utils.h, sed.c: added and made use of
2260 ck_memdup() function.
2262 * sed.c: protected a call to add1_buffer() in
2263 compile_program() which could have tried to
2264 push an EOF if a a/i/c command ended with
2265 a '\', EOF sequence.
2267 * utils.c: added sanity check to add1_buffer() so that
2268 EOF will not be added to the buffer.
2270 Wed Jul 16 03:56:26 PDT 1997 Ken Pizzini <ken@gnu.org>
2272 * configure.in, compat.h, compat.c: added memchr.
2274 * sed.c: got rid of arbitrary NUM_FPS limit;
2275 made global functions and variables "static" where appropriate;
2276 make various cosmetic changes, hopefully improving readability;
2277 simplified some redundant predicates;
2278 simplified some code, but nothing fundamental (yet?).
2280 Wed Jul 16 00:24:54 PDT 1997 Ken Pizzini <ken@gnu.org>
2282 * alloca.c, getopt.c, getopt.h, getopt1.c: updated from
2283 versions in textutils-1.22.
2285 * Makefile.in, Makefile.am, configure.in: put in automake support.
2287 * basicdefs.h, compat.h, compat.c [, sed.c, utils.c]: took out
2288 some very ugly compatibility #ifdefs and packaged into one
2291 * sed.c, utils.c: some gratuitous formatting changes.
2293 * utils.c: changed datatype of utils_id_s in order to
2294 eliminate arbitrary array size.
2296 Sun Jul 13 17:00:26 PDT 1997 Ken Pizzini <ken@gnu.org>
2298 * sed.c, utils.c, utils.h: de-linting oriented cleanup.
2300 Sun Jul 13 00:46:48 PDT 1997 Ken Pizzini <ken@gnu.org>
2302 * sed.c: fixed bug which caused SEGV for files missing a
2303 final newline. Corrected calls to regnexec to pass the
2304 proper parameters, in the proper order.
2306 Sat Dec 30 20:16:59 1995 Tom Lord <lord@beehive>
2308 *** Version 3.00 released
2310 * sed.c: Use posix entry points to regexp functions.
2311 Fix enough bugs to pass the test-suite.
2313 ....... Jason Molenda <crash@cygnus.com>
2315 * testsuite/: trippy test suite.
2318 Wed May 11 07:46:24 1994 Chip Salzenberg (chip@fin.uucp)
2320 *** Version 2.05 released
2322 * sed.c (compile_address): Recognize numeric addresses.
2323 Fixes typo made during installation of "~" feature.
2325 Sat Apr 30 17:17:38 1994 Tom Lord (lord@x1.cygnus.com)
2327 *** Version 2.04 released
2329 * sed.c: applied a patch from
2330 From: kap1@tao.cpe.uchicago.edu (Dietrich Kappe)
2334 As my contribution to the creeping feature creature in sed,
2335 here is a new type of address. The address has form n~m,
2336 which means "the line number is equal to n modulo m." The
2337 modifications to sed are trivial, and the general
2338 usefulness of this address should be obvious. If m is 0 or
2339 missing, 1 is used in its place (could be a bug or a
2342 Sat Apr 30 17:17:38 1994 Tom Lord (lord@x1.cygnus.com)
2344 * rx.c (solve_destination): protect `solution' more carefully.
2345 This is a cleanup of a patch from Kevin Buettner
2346 (kev@cujo.geg.mot.com).
2348 Sat Apr 30 17:17:38 1994 Tom Lord (lord@x1.cygnus.com)
2350 * rx.c: make translation tables unsigned chars
2352 * sed.c (main): Compile accumulated -e commands as
2353 soon as a -f command comes along. This ensures that
2354 the commands are executed in the right order.
2356 Mon Oct 25 14:41:47 1993 Tom Lord (lord@rtl.cygnus.com)
2358 * sed.c (execute_program): 'w' flushes the buffer after it
2359 writes -- diagnosed by doug@research.att.com. 'r' and 'w' to
2360 the same file is now supported -- hopefully even in a way that
2361 satisfies Posix (it now behaves differently from some
2362 /bin/sed's and the spec is hard to read so i'm not sure).
2364 Also, 'r' of a non-existent file is now permitted.
2366 Mon Oct 11 21:06:10 1993 Tom Lord (lord@cygnus.com)
2368 * sed.c (execute_program): remember that 'b' and 't' are more
2369 like longjmp than goto. Patch from tom@basil.icce.rug.nl (Tom
2372 * rx.c: patch from From: fin!chip@rutgers.edu (Chip
2373 Salzenberg) to get rid of compiler warnings.
2376 Sat Aug 7 01:04:59 1993 Tom Lord (lord@unix7.andrew.cmu.edu)
2378 *** Version 2.03 released
2380 * sed.c (compile_regex): report error messages for bogus
2383 SEE ALSO: ChangeLog.rx
2386 Wed Jul 21 00:28:03 1993 Tom Lord (lord@unix8.andrew.cmu.edu)
2388 * alloca.c: upgraded to a more recent version
2390 * rx.c (re_search_2): prefer matches with longer
2391 subexpressions to those with shorter ones, giving precedence
2392 to low numbered subexpressions.
2394 * rx.c (re_compile): don't free `params' if its null.
2396 Fri Jul 16 01:12:08 1993 Tom Lord (lord@unix8.andrew.cmu.edu)
2398 * rx.[ch], sed.c: rx replaces regex.
2402 Thu May 27 11:13:03 1993 Tom Lord (lord@unix3.andrew.cmu.edu)
2404 * sed.c (execute_program, match_addr): caught more cases
2405 that need to be sensitive to a missing \n at EOF.
2407 Fri May 21 00:39:22 1993 Tom Lord (lord@unix8.andrew.cmu.edu)
2409 * sed.c (execute_program): apply gaumondp's patch
2410 to fix '\xabcxs/foo/bar/'.
2412 * sed.c (execute_program):
2413 If a second address is a regexp, never match it on the
2414 same line as the first address.
2416 * sed.c (compile_regexp):
2417 Numeric ranges x,y s.t. y < x are now treated as x,x.
2418 There was a bug in that they were being handled like x,x+1.
2420 * sed.c (execute_program, read_pattern_space,
2421 append_pattern_space) don't add newlines to lines
2422 that don't have them.
2424 Wed May 19 13:34:45 1993 Tom Lord (lord@unix9.andrew.cmu.edu)
2426 * sed.c (compile_program): grok \\n in comments.
2428 Mon May 17 16:34:50 1993 Tom Lord (lord@unix9.andrew.cmu.edu)
2430 * alloca.c: new (standard) file
2432 * configure.in: AC_CONSTified
2434 * sed.c (compile_program): properly diagnose the error of
2435 a missing command (e.g. sed /x/). (thanks gaumondp)
2437 * sed.c (compile_regexp): handle character classes correctly.
2438 Thanks gaumondp@ERE.UMontreal.CA
2439 and schwab@issan.informatik.uni-dortmund.de.
2441 Thu May 6 12:37:18 1993 Tom Lord (lord@unix10.andrew.cmu.edu)
2443 * sed.c (compile_filename, execute_program): don't use
2444 `access' or `/dev/null'.
2446 * sed.c (execute_program): 'N' at EOF should delete the pat buf.
2448 * sed.c (compile_filename): truncate, don't append files
2449 being openned for `w' or `s///w'
2451 * sed.c (execute_program): -n switch shouldn't effect `i' or `c'.
2453 * sed.c (compile_program): don't compile unescaped newlines
2454 into the substitution string of an `s' command (they are an error).
2456 * sed.c (compile_regex): correctly skip over character
2457 sets that contain `]'.
2459 * sed.c (execute_program): patch from gaumondp
2460 Correctly handle empty-string matches in the case of an `s'
2461 command with a repeat count.
2463 * sed.c (compile_program): patch from gaumondp@ere.UMontreal.ca.
2464 Don't consume characters after the label of a `b', `t' or `:' command.
2466 * sed.c (compile_program): unmatched open braces are an error.
2468 * sed.c (compile_file): when consuming an initial comment,
2469 count lines correctly.
2471 Wed Nov 18 02:10:58 1992 Tom Lord (lord@unix2.andrew.cmu.edu)
2473 * sed.c (execute_program): Made s///p print even if -n was
2476 * sed.c (compile_string): Changed the type of this function to
2477 fix a compile warning.
2479 Wed Nov 4 17:15:34 1992 Tom Lord (lord@unix7.andrew.cmu.edu)
2481 * sed.c (main): Initialize the hold area to contain "\n"
2482 instead of "". In execute_program, all lines are expected
2483 to be newline terminated. Also, if H is the first command
2484 in the script, the result is a pattern buffer that begins
2485 with a blank line. Thanks to pinard@iro.umontreal.ca
2486 (Francois Pinard) for pointing out this and many other bugs.
2488 * sed.c (execute_program): Fixed a case of `D' command.
2489 Thanks Chris Weber <weber@bucknell.edu>
2491 * sed.c: added new tests of no_default_output to make -n work.
2492 Thanks Andrew Herbert <andrew@werple.apana.org.au>
2494 * sed.c, configure.in,Makefile.in: autoconfed bcopy and const.
2495 Thanks "J.T. Conklin" <jtc@gain.com>
2497 * sed.c: made prog_cur, prog_start, and prog_end unsigned so
2498 that users could write `sed -e s/ΓΏ/foo/g'.
2500 Tue Oct 13 00:04:05 1992 Tom Lord (lord@unix3.andrew.cmu.edu)
2502 * sed.c (execute_program): fixed the cycling behavior of 'D'
2504 * sed.c: integrated patch that closes files
2506 * sed.c: changed regexp syntax
2508 Fri May 22 15:11:12 1992 Tom Lord (lord at moriarty.bh.andrew.cmu.edu)
2510 * regex.c: this is not my change, but a pointer to the fact
2511 that karl@gnu fixed some regexp bugs that were plaguing sed.
2513 Thu Apr 30 13:02:21 1992 Tom Lord (lord at unix3.andrew.cmu.edu)
2515 * sed.c (compile_program, execute_program)
2516 subprograms are now compiled with an explicit continuation ;)
2517 return_v and return_i in struct vector. execute_program
2518 no longer recurses to execute subprograms (case '{') and now
2519 understands a return instruction (case '{').
2521 Tue Apr 28 17:13:04 1992 Tom Lord (lord at unix7.andrew.cmu.edu)
2523 * sed.c (compile_address) added \?regexp? syntax for addresses.
2525 * sed.c (main) added {} intervals to the obscure regexp
2528 * sed.c (compile_program) after calling compile_address,
2529 normalize numeric addresses (make a2.addr_number > a1.addr_number).
2530 This is necessary because line numbers must match exactly,
2531 but sed does not try to match a2 until after a1 has matched,
2532 yet a1,a2 where a2 <= a1 is defined to be equivelent to
2535 Sat Feb 29 10:55:54 1992 David J. MacKenzie (djm@nutrimat)
2537 * sed.c (usage): Document long options as starting with `--'.
2539 Mon Dec 9 23:56:40 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
2541 * sed.c: Include sys/types.h, for new regex.h.
2543 Tue Nov 5 02:16:01 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
2545 * utils.c: Change NO_VFPRINTF to VPRINTF_MISSING, for
2546 compatibility with autoconf.
2548 Mon Sep 2 22:02:40 1991 David J. MacKenzie (djm at apple-gunkies)
2550 * sed.c (compile_regex): Treat \ as a normal character when in
2553 Thu Aug 8 00:15:33 1991 David J. MacKenzie (djm at bleen)
2557 * sed.c (compile_filename): If reading a file fails, read
2558 /dev/null instead. It's what Unix and POSIX do, effectively.
2560 * sed.c (compile_regex): The 'slash' character doesn't
2561 terminate the regex if it's in a character class.
2563 * sed.c (main): If given no args, or bad option, print usage
2565 (usage): New function.
2567 * sed.c (execute_program): Amount written for 'P' command was
2568 wrong. From stephend@ksr.com (Stephen Davis).
2570 Wed Aug 7 16:51:14 1991 David J. MacKenzie (djm at apple-gunkies)
2572 * sed.c (append_pattern_space): Check for buffer full before
2573 instead of after writing to buffer. Don't need to test for
2574 EOF initially anymore, due to the next change.
2575 (execute_program): For 'n' and 'N' commands, if eof is reached
2576 in input, quit the script like Unix sed does.
2577 Fix memory allocation problems for 'a' and 'r' commands.
2578 (compile_program): Fix off by one error in processing comments.
2579 All of the above are from Tapani Tarvainen, tarvaine@tukki.jyu.fi.
2581 * sed.c (setup_jump): Use isblank instead of testing for ' '
2582 or '\t', for POSIX locales.
2584 * utils.c (ck_strdup): Renamed from strdup.
2585 * sed.c: Change callers.
2587 * sed.c, utils.c: Clean up declarations and includes to get
2588 rid of compiler warnings.
2590 * sed.c (main): Add long-named options. Don't complain if -n
2593 Fri Aug 2 12:33:16 1991 David J. MacKenzie (djm at apple-gunkies)
2595 * configure: Support +srcdir arg. Create config.status and
2596 remove it and Makefile if interrupted while creating them.
2597 * Makefile.in: Change DESTDIR to prefix.
2599 Mon Jul 15 13:07:39 1991 David J. MacKenzie (djm at wookumz.gnu.ai.mit.edu)
2601 * sed.c (main): Add -V option to print version number.
2602 (USAGE): Mention -V.
2604 Mon Jul 8 01:42:22 1991 David J. MacKenzie (djm at geech.gnu.ai.mit.edu)
2606 * sed.c: Define bcopy in terms of memcpy if STDC_HEADERS as
2608 (compile_filename): Don't glob filename (for 'r' and 'w'
2609 commands). Unix sed doesn't do it and it's not very useful,
2610 since it can only match 0 or 1 files.
2611 (execute_program): Change '\a' to 007 since some compilers
2613 * utils.c: New file; code moved from sed.c.
2614 * Replace Makefile with Makefile.in and configure.
2617 Tue Mar 26 13:00:48 EST 1991 Jay Fenlason (hack@gnu.ai.mit.edu)
2619 * sed.c (match_address) Added a trivial cast for portability.
2621 Mon Feb 25 13:23:29 EST 1991 Jay Fenlason (hack@ai.mit.edu)
2623 * sed.c Changed 's' command to work with latest version of regex()
2624 routines, which mysteriously changed somewhere in there. . .
2625 A one-line patch from David Eckelkamp (eckelkamp@mcc.com).
2627 Initialize the fastmap in the hopes that it'll make sed faster.
2629 Thu Feb 21 13:42:27 EST 1991 Jay Fenlason (hack@ai.mti.edu)
2631 * sed.c Change panic to compile with other __STDC__ compilers.
2633 Wed Jan 30 10:46:38 EST 1991 Jay Fenlason (hack@ai.mit.edu)
2635 * sed.c Changed version number. Made new release.
2637 Tue Nov 27 15:34:51 EST 1990 Jay Fenlason (hack@ai.mit.edu)
2639 * sed.c (setup_jump) Don't blow chunks if there isn't a label
2640 after a b or t command.
2642 (main) Don't panic if it a branch command doesn't have
2643 a label to branch to.
2645 (main) Collect all the -e arguments together and parse them
2646 all at once. This way, -e { -e mumble -e } will work.
2648 All these small patches from David Schmidt (davids@isc-br.isc-br.com)
2650 Tue Sep 11 12:51:37 EDT 1990 Jay Fenlason (hack@ai.mit.edu)
2652 * sed.c Changed some function forward declarations to use VOID *
2655 Mon Jul 16 11:12:54 EDT 1990 Jay Fenlason (hack@ai.mit.edu)
2657 * sed.c (ck_malloc) Use malloc(1) instead of malloc(0) if given
2658 a request for zero bytes.
2660 Tue Jun 5 02:05:37 1990 David J. MacKenzie (djm at albert.ai.mit.edu)
2662 * sed.c: Remove excess newlines from calls to panic.
2663 Reformat some comments to fit in 79 columns.
2664 Base whether to use void * on __STDC__, not __GNU__.
2665 (main): Add missing arg when printing usage message.
2666 Print usage if given invalid arg.
2667 (panic) [__STDC__]: Add missing ", ...".
2668 (compile_filename): Print correct error message if glob_filename
2671 Thu Apr 5 21:41:12 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
2673 * sed.c (execute_program, case 'r'): When need to realloc append.text,
2674 multiply append.alloc by 2 instead of adding
2675 cur_cmd->x.cmd_txt.text_len.
2677 Tue Mar 6 15:55:35 EST 1990 Jay Fenlason (hack@ai.mit.edu)
2679 * sed.c (compile_regex) Allocate 10 bytes extra space needed by
2682 Sun Feb 25 16:32:10 1990 Jim Kingdon (kingdon at pogo.ai.mit.edu)
2684 * sed.c (execute_program, case 'l'): Print \00 instead of \0.
2685 Print backslash as \\ not \.
2686 Print \xx instead of /xx.
2688 Thu Feb 1 14:02:28 EST 1990 hack@wookumz
2690 * sed.c (memchr) Use () inside inner loop so it will work correctly.
2691 A two character patch from Robert A Bruce (rab@allspice.berkeley.edu)
2693 Wed Sep 27 18:47:39 EDT 1989 hack@ai.mit.edu
2695 * sed.c (compile_regex) New function. When compiling regex,
2696 turn ^ into \` and $ into \' so that they won't match on embedded
2697 newlines. UN*X pattern matching is a crock.
2698 (compile_program, compile_address) call compile_regex.
2700 Mon Sep 18 10:15:32 EDT 1989 hack@ai.mit.edu
2702 * sed.c (compile_program): define translate as unsigned char * so
2703 that y command will work on non-ascii characters.
2705 Changed version number to 1.06.
2707 Thu Sep 14 15:57:08 EDT 1989 hack@ai.mit.edu
2709 * sed.c (compile_program) Let programs use ; to terminate } as
2712 (read_file) Print an error msg to stderr if it can't open an
2715 Thu Mar 23 18:04:46 1989 Randall Smith (randy at apple-gunkies.ai.mit.edu)
2717 * Makefile, sed.c: Added new copyright notice.
2719 * Makefile: Make distributions which follow the symlinks.
2723 1.05 Fixed error in 'r' (now does things in the right order)
2725 1.04 Fixed s/re/rep/[number]
2727 1.03 Fixes from Mike Haertel for regexps that match the
2728 empty string, and for Ritchie stdio (non-sticky EOF)
2730 1.02 Fixed 't', 'b', ':' to trim leading spaces and tabs
2731 Fixed \\ in replacement of 's' command
2734 1.01 Added s/re/rep/[digits]
2735 added #n as first line of script
2736 added filename globbing
2738 All in the name of POSIX
2740 1.00 Began (thinking about) distributing this file
2745 version-control: never