aboutsummaryrefslogtreecommitdiff
path: root/sed.c
AgeCommit message (Collapse)Author
2001-05-17Always print a newline after a matching substitution.Matt Kraai
2001-05-14...Need to print just a few more newlines.Mark Whitley
2001-05-14...And now that we're chomping lines, we need to re-add the newline later...Mark Whitley
2001-05-14We will chomp() lines so REG_NEWLINE does not break stuff. Thanks, Matt.Mark Whitley
2001-05-14Added REG_NEWLINE as cflags to xregcomp for normal addresses so EOL $ will workMark Whitley
2001-05-11Added support for 'r' command in sed.Mark Whitley
2001-04-20Fixed a buglet where an extra newline was being added after an insert commandMark Whitley
in some cases.
2001-04-20Made a correction to a bad test expression. Props to Larry Doolittle forMark Whitley
spotting this one.
2001-03-26Applied patch from Anthony Towns that he posted to Debian bug tracking.Mark Whitley
2001-03-14Applied patch from Erik Habbinga to fix a problem with an uninitializedMark Whitley
substitution delimiter.
2001-02-17Get rid of long stale usage message code.Eric Andersen
-Erik
2001-02-14This patch, put together by Manuel Novoa III, is a merge of workEric Andersen
done by Evin Robertson (bug#1105) and work from Manuel to make usage messages occupy less space and simplify how usage messages are displayed.
2001-02-01Fix wget error message and add (and use) chomp library function.Matt Kraai
2001-01-31Removed trailing \n from error_msg{,_and_die} messages.Matt Kraai
2001-01-27Fix up copyright msgs. Bump version to 0.49 in preparation forEric Andersen
a release. Update the website with release details. -Erik
2001-01-27Fix header file usage -- there were many unnecessary header files included inEric Andersen
busybox.h which slowed compiles. I left only what was needed and then fixed up all the apps to include their own header files. I also fixed naming for pwd.h and grp.h functions. Tested to compile and run with libc5, glibc, and uClibc. -Erik
2001-01-04Changed email address to codepoet.org, updated list of applets / docs IMark Whitley
maintain in AUTHORS.
2001-01-02I just whipped up support for arbitrary regex delimiters, soEric Andersen
now things such as $ echo foo | sed 'sxfooxb\arx' bar will work as expected (and so doogie can stop complaining). -Erik
2000-12-22Use busybox error handling functions wherever possible.Matt Kraai
2000-12-18Change calls to error_msg.* and strerror to use perror_msg.*.Matt Kraai
2000-12-07Changed names of functions in utility.c and all affected files, to makeMark Whitley
compliant with the style guide. Everybody rebuild your tags file!
2000-11-14Remove unneeded junkEric Andersen
2000-11-03Removed REG_NEWLINE from regcomp to fix the same bug found in grep where itMark Whitley
would not match blank lines (bug #1064). Followed Matt Kraii's suit on his 1.42 revision of grep. Tested it, works.
2000-11-03Now, what was that logic block doing up there?Mark Whitley
2000-11-03Re-worked the support for s///p, fixed a backref limit buglet, and cleaned upMark Whitley
a few other ugly places (do_subst_command got a much-needed overhaul). Also took out BB_FEATURE_SED_PATTERN_SPACE from Config.h[.Hurd] as the 'p' is now a standard feature (adds almost no bloat).
2000-09-27Consolidate handling of some fopen failures.Matt Kraai
2000-09-25Renamed "internal.h" to the more sensible "busybox.h".Eric Andersen
-Erik
2000-09-13Fix calls to {m,c,re}alloc so that they use x{m,c,re}alloc instead ofMatt Kraai
segfaulting or handling errors the same way themselves.
2000-08-21Applied patch from Mark Ferrell <mferrell@mvista.com> to use the 'p' option inMark Whitley
substitution expressions.
2000-08-10Applied patch from Mark Ferrell <mferrell@mvista.com> to fix sed '1,$p' whereMark Whitley
sed was only printing the first line and then exiting.
2000-07-25Modified print_subst_w_backrefs() so it will print backslash escapedMark Whitley
characters properly, just like GNU sed.
2000-07-25Use BB_FEATURE_CLEAN_UP where appropriateEric Andersen
-Erik
2000-07-20As per a discussion on the mailing list between Matt and Pavel. I have removedMark Whitley
the -V (version) flag from busybox sed. It is unnecessary because sed is not a standalone and should therefore be independently reporting a version number. Moreover, it is extra code that we just don't need.
2000-07-19Centralize handling of --help.Matt Kraai
2000-07-17New message added to messages.c: full_versionPavel Roskin
Used where possible
2000-07-17 - Added support for backreferences in substitution expressions up to nineMark Whitley
(\1, \2...\9). This touched a lot of places in this file and I added a new function 'print_subst_w_backrefs' in order to keep 'do_subst_command' a little more tidy. * I tested this good 'n hard, but will always appreciate more testing from other, willing folks. - Noticed that the index_of_next_unescaped_slash was subtly wrong so I changed both the functionality and behavior (it used to skip over the first char in the string you passed it, assuming it was a leading '/'--this assumption is no longer made) this necessitated changing the lines that call this function just slightly.
2000-07-16Extract usage information into a separate file.Matt Kraai
2000-07-14Fixed a couple of buglets:Mark Whitley
- add_cmd_str: segv's were being generated if there was a '# comment' line (and probably other kinds of lines, too) that was not followed by a semi-colon or whitespace - parse_edit_cmd: was returning a wrong number (too low) for the index; it was not accounting for backslashes eaten, for the fact that we start at the 3rd index in the string, or for the fact that we add an extra newline. - parse_cmd_str: was returning a wrong number (again, too low) for the index in the case of single-letter commands (p,d). There was some over-compensation for this in the 'return' stmt at the end which also needed some help. - load_cmd_file: was not eating trailing newlines off the line read from the command file. This had the deleterious effect of printing an extra newlines after text displayed from edit (i,a,c) commands.
2000-07-14 - Added support for semicolon delimited command lines. (woo-hoo!)Mark Whitley
- Obsoleted the trim_str function (#if 0'ed out -- maybedelete later) in favor of strrspn. - Obsoleted the strrspn function (#if 0'ed out as well) as soon as I discovered that it wasn't needed either. - Fixed a subtle bug in parse_subst_cmd where it would choke with an error if there was any trailing space after the s/match/replace/ expression.
2000-07-14Use errorMsg rather than fprintf.Matt Kraai
2000-07-14It dawned on me that I would need to grow a char buffer one extra char biggerMark Whitley
to accomodate a trailing '\n'ewline that I append to it later one. This is only necessary for the case of one inserted, appended, or changed line, but it's still necessary.
2000-07-14Added error checking for edit commands; only a beginning address can beMark Whitley
specified.
2000-07-14Added support for (a)ppend, (i)nsert, and (c)hange commands to sed.Mark Whitley
2000-07-13Fixed bug where sed '/foo/p' was printing "invalid command".Mark Whitley
2000-07-13(Something I should have done in the previous checkin...) Also broke outMark Whitley
substitution command execution from do_sed_command() and put it in it's own do_subst_command() function.
2000-07-13Minor code reorg: Changed the interface to index_of_next_unescaped_slash to anMark Whitley
interface that seems a little more sensible to me. Also broke out s/// expression parsing into it's own subroutine.
2000-07-12Changed bb_regcomp to xregcomp and #if 0'ed out destroy_cmd_strs in sed.cMark Whitley
(maybe I'll remove it later).
2000-07-12Always report the applet name when doing error reporting.Matt Kraai
2000-07-11Applied patch from Matt Kraai to call destroy_cmd_strs in atexit(), ratherMark Whitley
than peppering it throughout the code.
2000-07-11Applied patch from Matt Kraai which does the following:Mark Whitley
- adds case-insensitive matching in sed s/// epxressions - consolodates common regcomp code in grep & sed into bb_regcomp and put in utility.c - cleans up a bunch of cruft