aboutsummaryrefslogtreecommitdiff
path: root/sed.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Preserve whether or not the line was previously altered when running akraai2001-07-301-2/+2
| | | | | | | subst command (discovery and patch by Jim Gleason). git-svn-id: svn://busybox.net/trunk/busybox@3159 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Removed obsolete function, strdup_substr.kraai2001-07-051-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@3010 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Rewrote mkdir (and touched lots of things in the process).kraai2001-06-211-9/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2873 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Always apply commands with no specified range.kraai2001-06-211-0/+4
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2868 69ca8d6d-28ef-0310-b511-8ec308f3f277
* - Fixed bug where you couldn't mix line number and regexes in two-address cmdsmarkw2001-06-111-117/+132
| | | | | | | | | - Fixed bug where you couldn't use two addresses for a 'c' cmd - Moved the do_sed_cmd function into process_file to simplify some things - Reduced a buncha lines of code in the process git-svn-id: svn://busybox.net/trunk/busybox@2811 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use safe_strncpy.kraai2001-05-271-3/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2753 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from larry to fix some grammar errors.andersen2001-05-231-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2715 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Always print a newline after a matching substitution.kraai2001-05-171-6/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2664 69ca8d6d-28ef-0310-b511-8ec308f3f277
* ...Need to print just a few more newlines.markw2001-05-141-2/+5
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2641 69ca8d6d-28ef-0310-b511-8ec308f3f277
* ...And now that we're chomping lines, we need to re-add the newline later...markw2001-05-141-3/+3
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2639 69ca8d6d-28ef-0310-b511-8ec308f3f277
* We will chomp() lines so REG_NEWLINE does not break stuff. Thanks, Matt.markw2001-05-141-0/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2638 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Added REG_NEWLINE as cflags to xregcomp for normal addresses so EOL $ will workmarkw2001-05-141-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2636 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Added support for 'r' command in sed.markw2001-05-111-10/+73
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2621 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed a buglet where an extra newline was being added after an insert commandmarkw2001-04-201-7/+10
| | | | | | | in some cases. git-svn-id: svn://busybox.net/trunk/busybox@2395 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Made a correction to a bad test expression. Props to Larry Doolittle formarkw2001-04-201-2/+1
| | | | | | | spotting this one. git-svn-id: svn://busybox.net/trunk/busybox@2394 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Applied patch from Anthony Towns that he posted to Debian bug tracking.markw2001-03-261-2/+3
| | | | git-svn-id: svn://busybox.net/trunk/busybox@2197 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Applied patch from Erik Habbinga to fix a problem with an uninitializedmarkw2001-03-141-0/+4
| | | | | | | substitution delimiter. git-svn-id: svn://busybox.net/trunk/busybox@2082 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Get rid of long stale usage message code.andersen2001-02-171-4/+3
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@1849 69ca8d6d-28ef-0310-b511-8ec308f3f277
* This patch, put together by Manuel Novoa III, is a merge of workandersen2001-02-141-2/+2
| | | | | | | | | done by Evin Robertson (bug#1105) and work from Manuel to make usage messages occupy less space and simplify how usage messages are displayed. git-svn-id: svn://busybox.net/trunk/busybox@1805 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix wget error message and add (and use) chomp library function.kraai2001-02-011-2/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1734 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Removed trailing \n from error_msg{,_and_die} messages.kraai2001-01-311-10/+10
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1732 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix up copyright msgs. Bump version to 0.49 in preparation forandersen2001-01-271-1/+1
| | | | | | | | a release. Update the website with release details. -Erik git-svn-id: svn://busybox.net/trunk/busybox@1697 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix header file usage -- there were many unnecessary header files included inandersen2001-01-271-0/+2
| | | | | | | | | | 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 git-svn-id: svn://busybox.net/trunk/busybox@1695 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Changed email address to codepoet.org, updated list of applets / docs Imarkw2001-01-041-1/+1
| | | | | | | maintain in AUTHORS. git-svn-id: svn://busybox.net/trunk/busybox@1537 69ca8d6d-28ef-0310-b511-8ec308f3f277
* I just whipped up support for arbitrary regex delimiters, soandersen2001-01-021-63/+18
| | | | | | | | | | | now things such as $ echo foo | sed 'sxfooxb\arx' bar will work as expected (and so doogie can stop complaining). -Erik git-svn-id: svn://busybox.net/trunk/busybox@1513 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use busybox error handling functions wherever possible.kraai2000-12-221-4/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1489 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Change calls to error_msg.* and strerror to use perror_msg.*.kraai2000-12-181-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1466 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Changed names of functions in utility.c and all affected files, to makemarkw2000-12-071-11/+11
| | | | | | | compliant with the style guide. Everybody rebuild your tags file! git-svn-id: svn://busybox.net/trunk/busybox@1398 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Remove unneeded junkandersen2000-11-141-4/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1296 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Removed REG_NEWLINE from regcomp to fix the same bug found in grep where itmarkw2000-11-031-1/+1
| | | | | | | | would not match blank lines (bug #1064). Followed Matt Kraii's suit on his 1.42 revision of grep. Tested it, works. git-svn-id: svn://busybox.net/trunk/busybox@1284 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Now, what was that logic block doing up there?markw2000-11-031-6/+6
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1283 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Re-worked the support for s///p, fixed a backref limit buglet, and cleaned upmarkw2000-11-031-71/+86
| | | | | | | | | 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). git-svn-id: svn://busybox.net/trunk/busybox@1282 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Consolidate handling of some fopen failures.kraai2000-09-271-3/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@1136 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Renamed "internal.h" to the more sensible "busybox.h".andersen2000-09-251-1/+1
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@1119 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix calls to {m,c,re}alloc so that they use x{m,c,re}alloc instead ofkraai2000-09-131-3/+2
| | | | | | | segfaulting or handling errors the same way themselves. git-svn-id: svn://busybox.net/trunk/busybox@1039 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Applied patch from Mark Ferrell <mferrell@mvista.com> to use the 'p' option inmarkw2000-08-211-9/+39
| | | | | | | substitution expressions. git-svn-id: svn://busybox.net/trunk/busybox@965 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Applied patch from Mark Ferrell <mferrell@mvista.com> to fix sed '1,$p' wheremarkw2000-08-101-2/+2
| | | | | | | sed was only printing the first line and then exiting. git-svn-id: svn://busybox.net/trunk/busybox@945 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Modified print_subst_w_backrefs() so it will print backslash escapedmarkw2000-07-251-0/+6
| | | | | | | characters properly, just like GNU sed. git-svn-id: svn://busybox.net/trunk/busybox@907 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use BB_FEATURE_CLEAN_UP where appropriateandersen2000-07-251-2/+2
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@904 69ca8d6d-28ef-0310-b511-8ec308f3f277
* As per a discussion on the mailing list between Matt and Pavel. I have removedmarkw2000-07-201-5/+1
| | | | | | | | | 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. git-svn-id: svn://busybox.net/trunk/busybox@889 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Centralize handling of --help.kraai2000-07-191-4/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@883 69ca8d6d-28ef-0310-b511-8ec308f3f277
* New message added to messages.c: full_versionproski2000-07-171-1/+4
| | | | | | | Used where possible git-svn-id: svn://busybox.net/trunk/busybox@871 69ca8d6d-28ef-0310-b511-8ec308f3f277
* - Added support for backreferences in substitution expressions up to ninemarkw2000-07-171-18/+76
| | | | | | | | | | | | | | | | | | (\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. git-svn-id: svn://busybox.net/trunk/busybox@869 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Extract usage information into a separate file.kraai2000-07-161-16/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@864 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fixed a couple of buglets:markw2000-07-141-6/+29
| | | | | | | | | | | | | | | | | | | - 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. git-svn-id: svn://busybox.net/trunk/busybox@862 69ca8d6d-28ef-0310-b511-8ec308f3f277
* - Added support for semicolon delimited command lines. (woo-hoo!)markw2000-07-141-31/+72
| | | | | | | | | | | | - 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. git-svn-id: svn://busybox.net/trunk/busybox@861 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use errorMsg rather than fprintf.kraai2000-07-141-3/+3
| | | | git-svn-id: svn://busybox.net/trunk/busybox@848 69ca8d6d-28ef-0310-b511-8ec308f3f277
* It dawned on me that I would need to grow a char buffer one extra char biggermarkw2000-07-141-1/+4
| | | | | | | | | 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. git-svn-id: svn://busybox.net/trunk/busybox@845 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Added error checking for edit commands; only a beginning address can bemarkw2000-07-141-1/+4
| | | | | | | specified. git-svn-id: svn://busybox.net/trunk/busybox@844 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Added support for (a)ppend, (i)nsert, and (c)hange commands to sed.markw2000-07-141-7/+88
| | | | git-svn-id: svn://busybox.net/trunk/busybox@843 69ca8d6d-28ef-0310-b511-8ec308f3f277