aboutsummaryrefslogtreecommitdiff
path: root/editors (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* more const, attribute_noreturn saved 200 bytesvodz2005-10-191-24/+26
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11886 69ca8d6d-28ef-0310-b511-8ec308f3f277
* - consume space between functionname and opening bracketsaldot2005-10-171-1/+2
| | | | | | | Fixes Rob's issue using busybox awk for building gcc-4_0 optionlist (http://busybox.net/lists/busybox/2005-October/016659.html) git-svn-id: svn://busybox.net/trunk/busybox@11883 69ca8d6d-28ef-0310-b511-8ec308f3f277
* common BUFSIZ BSS buffer, small reduce code, data and bssvodz2005-10-151-1/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11867 69ca8d6d-28ef-0310-b511-8ec308f3f277
* - do not use bb_xgetularg10_bnd as a lower value of -1 doesn't work due to lowealdot2005-10-101-20/+6
| | | | | | | | | being unsigned. - minor correction: use stdin only when no file was given via -i. - use shorter boilerplate. git-svn-id: svn://busybox.net/trunk/busybox@11824 69ca8d6d-28ef-0310-b511-8ec308f3f277
* catch and report errors from file_write()pgf2005-10-091-15/+28
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11817 69ca8d6d-28ef-0310-b511-8ec308f3f277
* make Hit_Return() available when CONFIG_FEATURE_VI_COLON is off. it'spgf2005-10-091-2/+3
| | | | | | | needed elsewhere as well now. git-svn-id: svn://busybox.net/trunk/busybox@11816 69ca8d6d-28ef-0310-b511-8ec308f3f277
* change strange depend to libbb.h, but require busybox.hvodz2005-10-061-1/+0
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11791 69ca8d6d-28ef-0310-b511-8ec308f3f277
* as pointed out in Bug 17, use uint32_t instead of unsigned long since the ↵vapier2005-09-271-20/+20
| | | | | | code expects the size of the info variables to be 32bits and sizeof(long) on 64bit hosts is not 32bits git-svn-id: svn://busybox.net/trunk/busybox@11661 69ca8d6d-28ef-0310-b511-8ec308f3f277
* eat misappropriated whitespacevapier2005-09-271-66/+66
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11659 69ca8d6d-28ef-0310-b511-8ec308f3f277
* uncuddle function scope bracketsvapier2005-09-271-116/+116
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11658 69ca8d6d-28ef-0310-b511-8ec308f3f277
* use the shorter license headervapier2005-09-241-15/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11624 69ca8d6d-28ef-0310-b511-8ec308f3f277
* use brief license linevapier2005-09-241-15/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11618 69ca8d6d-28ef-0310-b511-8ec308f3f277
* initialize a couple of vars whose warnings were suppressed becausepgf2005-09-161-1/+1
| | | | | | | i was building w/ debug on before, which suppresses optimization. git-svn-id: svn://busybox.net/trunk/busybox@11479 69ca8d6d-28ef-0310-b511-8ec308f3f277
* some combinations of status line and screen refresh don't give apgf2005-09-161-76/+112
| | | | | | | | | | | | | | | | | | | | correct screen, and bug 215 reports trouble with the status line on small screens. with this change a) the status line should always be refreshed properly, b) the status line is a little shorter than it used to be ("I" instead of "--INSERT--"), c) the status line will be truncated if it doesn't fit on the screen, and d) if the screen is too narrow for an error or transient status message (from psb() or psbs()), then that message will be followed by a "Hit Return" prompt. (it wasn't until i did this last bit that the size grew. with this, these changes add about 150 bytes.) - pgf git-svn-id: svn://busybox.net/trunk/busybox@11477 69ca8d6d-28ef-0310-b511-8ec308f3f277
* split libbb: moved xregcomp separatelly for speed up recompilevodz2005-09-142-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11464 69ca8d6d-28ef-0310-b511-8ec308f3f277
* removed strange extern void xregcomp(... from some applets, but declared ↵vodz2005-09-141-1/+0
| | | | | | from libbb.h git-svn-id: svn://busybox.net/trunk/busybox@11463 69ca8d6d-28ef-0310-b511-8ec308f3f277
* allow either backspace or DEL, in addition to the user's erasepgf2005-09-131-1/+2
| | | | | | | char, to be used in get_input_line() git-svn-id: svn://busybox.net/trunk/busybox@11451 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Missing break was screwing up 'y//' command. Bug #248.landley2005-09-021-0/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11312 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch -i support from Berhnard Fischer.landley2005-09-011-9/+19
| | | | git-svn-id: svn://busybox.net/trunk/busybox@11307 69ca8d6d-28ef-0310-b511-8ec308f3f277
* use toplevel ARFLAGS and update default ARFLAGS to be quietvapier2005-07-271-1/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@10923 69ca8d6d-28ef-0310-b511-8ec308f3f277
* applying fix for:pgf2005-07-201-0/+1
| | | | | | | | 0000118: vi join command does not mark file as modified for certain lines. git-svn-id: svn://busybox.net/trunk/busybox@10873 69ca8d6d-28ef-0310-b511-8ec308f3f277
* allow both ^H and DEL to backspace in insert mode (bug #23)pgf2005-07-181-4/+4
| | | | git-svn-id: svn://busybox.net/trunk/busybox@10851 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix vi so that error messages, insert mode messages, etc areandersen2005-07-181-12/+37
| | | | | | | all actually displayed in the status line as expected git-svn-id: svn://busybox.net/trunk/busybox@10849 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Dmitry Zakharov:landley2005-06-071-2/+1
| | | | | | | | | | | | | | | | | | Charlie Brady wrote: > Here's another awk parsing problem - unary post increment - pre is fine: > >bash-2.05a$ echo 2,3 | gawk -F , '{ $2++ }' >bash-2.05a$ echo 2,3 | /tmp/busybox/busybox awk -F , '{ $2++ }' >awk: cmd. line:1: Unexpected token > Here's a fix for this. There is another problem with constructions like "print (A+B) ++C", I don't know whether somebody uses such constructions (fixing both these problems would require very serious change in awk code). git-svn-id: svn://busybox.net/trunk/busybox@10478 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Colin Watson (mangled slightly by Rob Landley):landley2005-05-181-6/+10
| | | | | | | | | | | | | This patch implements the 'T' command in sed. This is a GNU extension, but one of the udev hotplug scripts uses it, so I need it in busybox anyway. Includes a test; 'svn add testsuite/sed/sed-branch-conditional-inverted' after applying. git-svn-id: svn://busybox.net/trunk/busybox@10347 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Doug Swarin pointed out a security bug in the -i option of sed.landley2005-05-181-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the permissions on the temp file are correct to prevent it from being maliciously mangled by passing strangers, (created with 600, opened O_EXCL, etc), the permissions on the _directory_ might not be, and we re-open the file to convert the filehandle to a FILE * (and automatically get an error message and exit if the directory's read-only or out of space or some such). This opens a potential race condition if somebody's using dnotify on the directory, deletes/renames the tempfile, and drops a symlink or something there. Somebody running sed -i as root in a world writeable directory could do damage. I dug up notes on an earlier discussion where we looked at the security implications of this (unfortunately on the #uclibc channel rather than email; I don't have a transcript, just notes-to-self) which pointed out that if the permissions on the directory allow other people's files to be deleted/renamed then the original file is vulnerable to sabotage anyway. However, there are two cases that discussion apparently didn't take into account: 1) Using another user's permissions to damage files in other directories you can't access (standard symlink attack). 2) Reading data another user couldn't otherwise access by having the new file belong to that other user. This patch uses fdopen to convert the filehandle into a FILE *, rather than reopening the file. git-svn-id: svn://busybox.net/trunk/busybox@10346 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Bernhard Fischer to make a bunch of symbols staticandersen2005-04-161-12/+12
| | | | | | | which were otherwise cluttering the global namespace. git-svn-id: svn://busybox.net/trunk/busybox@10121 69ca8d6d-28ef-0310-b511-8ec308f3f277
* In Bug 208, bernhardf writes:vapier2005-04-161-6/+6
| | | | | | | | | On machines with only ANSI compliant compilers, not explitily delcaring an empty parameter list 'void' causes failure. git-svn-id: svn://busybox.net/trunk/busybox@10113 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Hiroshi found another bug. Currently sed's $ triggers at end of every file,landley2004-11-251-28/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | and with multiple files SuSv3 says it should only trigger at the end of the LAST file. The trivial fix I tried first broke if the last file is empty. Fixing this properly required restructuring things to create a file list (actually a FILE * list), and then processing it all in one go. (There's probably a smaller way to do this, merging with append_list perhaps. But let's get the behavior correct first.) Note that editing files in place (-i) needs the _old_ behavior, with $ triggering at the end of each file. Here's a test of all the things this patch fixed. gnu and busybox seds produce the same results with this patch, and different without it. echo -n -e "1one\n1two\n1three" > ../test1 echo -n > ../test2 echo -e "3one\n3two\n3three" > ../test3 sed -n "$ p" ../test1 ../test2 ../test3 sed -n "$ p" ../test1 ../test2 sed -i -n "$ p" ../test1 ../test2 ../test3 git-svn-id: svn://busybox.net/trunk/busybox@9530 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Hiroshi Ito found some bugs. The 'c' command (cut and paste) was hardwiredlandley2004-10-301-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | to not put a newline at the end (which was backwards, it should have been hardwired _to_ put a newline at the end, whether or not the input line ended with a newline). Test case for that: echo | sed -e '$ctest' And then this would segfault: echo | sed -e 'g' Because pattern_space got freed but the dead pointer was only overwritten in an if statement that didn't trigger if the hold space was empty. Oops. While debugging it, I found out that the hold space is persistent between multiple input files, so I promoted it to a global and added it to the memory cleanup. The relevant test case (to compare with That Other Sed) is: echo -n woo > woo sed -e h -e g woo echo "fish" | sed -e '/woo/h' -e "izap" -e 's/woo/thingy/' -e '/fish/g' woo - And somebody gratuitously stuck in a c99 int8_t type for something that's just a flag, so I grouped the darn ints. git-svn-id: svn://busybox.net/trunk/busybox@9486 69ca8d6d-28ef-0310-b511-8ec308f3f277
* egor duda writes:andersen2004-10-082-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | Hi! I've created a patch to busybox' build system to allow building it in separate tree in a manner similar to kbuild from kernel version 2.6. That is, one runs command like 'make O=/build/some/where/for/specific/target/and/options' and everything is built in this exact directory, provided that it exists. I understand that applyingc such invasive changes during 'release candidates' stage of development is at best unwise. So, i'm currently asking for comments about this patch, starting from whether such thing is needed at all to whether it coded properly. 'make check' should work now, and one make creates Makefile in build directory, so one can run 'make' in build directory after that. One possible caveat is that if we build in some directory other than source one, the source directory should be 'distclean'ed first. egor git-svn-id: svn://busybox.net/trunk/busybox@9320 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Dmitry Zakharov to fix a bug triggered by freeswan's scripts.bug12004-09-241-1/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@9277 69ca8d6d-28ef-0310-b511-8ec308f3f277
* regularly update the status line displayandersen2004-08-191-4/+4
| | | | | | | -Erik git-svn-id: svn://busybox.net/trunk/busybox@9131 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Simon Poole reports that awk segfaults when environment variablesandersen2004-07-301-0/+4
| | | | | | | | | | | | | | with no value exist, i.e. $ export BOB='' % ./busybox awk Segmentation fault This patch teaches awk to not blow chunks on empty env variables. -Erik git-svn-id: svn://busybox.net/trunk/busybox@9054 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Dmitry Zakharov to fix a bug discovered via the freeswapbug12004-07-231-0/+1
| | | | | | | script. git-svn-id: svn://busybox.net/trunk/busybox@9006 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Assign 'forced' before the goto to avoid a warningandersen2004-07-201-2/+3
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8971 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Rob Landley writes:andersen2004-05-261-4/+7
| | | | | | | | | | | | | | add sed -r support. I bumped into a couple of things that want to use extended regular expressions in sed, and it really isn't that hard to add. Can't say I've extensively tested it, but it's small and isn't going to break anything that doesn't use it, so... Rob git-svn-id: svn://busybox.net/trunk/busybox@8870 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Use int instead of char for return type, in theory avoiding a castbug12004-05-161-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8845 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Fix for debian bug #248106, should use int for returned getopt value.bug12004-05-101-1/+3
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8819 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Update my email address, document some of my tasks in the AUTHORS filebug12004-04-252-2/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8782 69ca8d6d-28ef-0310-b511-8ec308f3f277
* This sed patch can only be described as "duh". Stat the source file, chmodandersen2004-04-211-1/+1
| | | | | | | | | | | | | | the _destination_ file. (Ah hah! That works _much_ better...) I implemented the behavior, I just forgot to test this corner of it. My fault, sorry... No, gnu sed -i doesn't preverve ownership information. I checked. Permissions, yes, ownership info, no. Rob git-svn-id: svn://busybox.net/trunk/busybox@8776 69ca8d6d-28ef-0310-b511-8ec308f3f277
* So I'm building a linux from scratch system, using a working script to do thisandersen2004-04-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that the _only_ change to is that gnu sed has been replaced with busybox sed. And ncurses' install phase hangs. I trace it down, and it's trying to run gawk. (Insert obligatory doubletake, but this is FSF code we're talking about, so...) It turns out gawk shells out to sed, ala "sed -f /tmp/blah file.h". The /tmp/blah file is basically empty (it contains one character, a newline). So basically, gawk is using sed as "cat". With gnu sed, it works like cat, anyway. With busybox sed, it tests if its command list is empty after parsing the command line, and if the list is empty it takes the first file argument as a sed command string, and if that leaves the file list empty it tries to read the data to operate on from stdin. (Hence the hang, since nothing's coming in on stdin...) It _should_ be testing whether there were any instances of -f or -e, not whether it actually got any commands. Using sed as cat may be kind of stupid, but it's valid and gawk relies on this behavior. Here's a patch to fix it, turning a couple of ints into chars in hopes of saving a bit of the space this adds. Comments? Rob git-svn-id: svn://busybox.net/trunk/busybox@8775 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Larry Doolittle writes:andersen2004-04-143-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | This is a bulk spelling fix patch against busybox-1.00-pre10. If anyone gets a corrupted copy (and cares), let me know and I will make alternate arrangements. Erik - please apply. Authors - please check that I didn't corrupt any meaning. Package importers - see if any of these changes should be passed to the upstream authors. I glossed over lots of sloppy capitalizations, missing apostrophes, mixed American/British spellings, and German-style compound words. What is "pretect redefined for test" in cmdedit.c? Good luck on the 1.00 release! - Larry git-svn-id: svn://busybox.net/trunk/busybox@8759 69ca8d6d-28ef-0310-b511-8ec308f3f277
* The last patch broke:landley2004-04-011-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sed -i "/^boo/a fred" ipsec.conf Which works in gnu sed. (And is _supposed_ to strip all the whitespace before "fred".) It also broke: sed -i -e "/^boo/a \\" -e " fred" ipsec.conf I.E. there can legally be spaces between the a and the backslash at the end of the line. And strangely enough, gnu sed accepts the following syntax as well: sed -i "/^boo/a \\ fred" ipsec.conf Which is a way of having the significant whitespace at the start of the line, all on one line. (But notice that the whitespace BEFORE the slash is still stripped, as is the slash itself. And notice that the naieve placement of "\n" there doesn't work, it puts an n at the start of the appended line. The double slashing is for shell escapes because you could escape the quote, you see. It's turned into a single backslash. But \n there is _not_ turned into a newline by the shell. So there.) This makes all three syntaxes work in my tests. I should probably start writing better documentation at some point. I posted my current sedtests.py file to the list, which needs a lot more tests added as well... git-svn-id: svn://busybox.net/trunk/busybox@8680 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Junio Hamano, junio at twinsun dot com writes:andersen2004-03-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The sed command in busybox 1.0.0-pre8 loses leading whitespace in 'a' command ('i' and 'c' commands are also affected). A patch to fix this is attached at the end of this message. The following is a transcript that reproduces the problem. The first run uses busybox 1.0.0-pre3 as "/bin/sed" command, which gets the expected result. Later in the test, /bin/sed symlink is changed to point at busybox 1.0.0-pre8 and the test script is run again, which shows the failure. === reproduction recipe === * Part 1. Use busybox 1.0.0-pre3 as sed; this works. root# cd /tmp root# cat 1.sh #!/bin/sh cd /tmp rm -f ipsec.conf ipsec.conf+ cat >ipsec.conf <<\EOF version 2.0 config setup klipsdebug=none plutodebug=none plutostderrlog=/dev/null conn %default keyingtries=1 ... EOF sed -e '/^config setup/a\ nat_traversal=yes' ipsec.conf >ipsec.conf+ mv -f ipsec.conf+ ipsec.conf root# sh -x 1.sh + cd /tmp + rm -f ipsec.conf ipsec.conf+ + cat + sed -e /^config setup/a\ nat_traversal=yes ipsec.conf + mv -f ipsec.conf+ ipsec.conf root# cat ipsec.conf version 2.0 config setup nat_traversal=yes klipsdebug=none plutodebug=none plutostderrlog=/dev/null conn %default keyingtries=1 ... root# sed --version sed: invalid option -- - BusyBox v1.00-pre3 (2004.02.26-18:47+0000) multi-call binary Usage: sed [-nef] pattern [files...] * Part 2. Continuing from the above, use busybox 1.0.0-pre8 as sed; this fails. root# ln -s busybox-pre8 /bin/sed-8 root# mv /bin/sed-8 /bin/sed root# sed --version This is not GNU sed version 4.0 root# sed -- BusyBox v1.00-pre8 (2004.03.30-02:44+0000) multi-call binary Usage: sed [-nef] pattern [files...] root# sh -x 1.sh + cd /tmp + rm -f ipsec.conf ipsec.conf+ + cat + sed -e /^config setup/a\ nat_traversal=yes ipsec.conf + mv -f ipsec.conf+ ipsec.conf root# cat ipsec.conf version 2.0 config setup nat_traversal=yes klipsdebug=none plutodebug=none plutostderrlog=/dev/null conn %default keyingtries=1 ... root# === reproduction recipe ends here === This problem was introduced in 1.0.0-pre4. The problem is that the command argument parsing code strips leading whitespaces too aggressively. When running the above example, the piece of code in question gets "\n\tnat_traversal=yes" as its argument in cmdstr variable (shown part in the following patch). What it needs to do at this point is to strip the first newline and nothing else, but it instead strips all the leading whitespaces at the beginning of the string, thus losing the tab character. The following patch fixes this. git-svn-id: svn://busybox.net/trunk/busybox@8676 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Thomas Winkler -- vi -R did not workandersen2004-03-311-1/+2
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8673 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Remove trailing whitespace. Update copyright to include 2004.andersen2004-03-157-54/+54
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8630 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Patch from Dmitry Zakharov, this line was missedfrom the last patchbug12004-02-221-0/+1
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8548 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Add -i option to sed, to edit files in-place.landley2004-02-181-7/+54
| | | | git-svn-id: svn://busybox.net/trunk/busybox@8510 69ca8d6d-28ef-0310-b511-8ec308f3f277
* Richard Kojedzinszky writes:andersen2004-02-061-2/+2
| | | | | | | | | | | | Hi All, I aplogoize for the mistake, but i have just recognized that somehow the last patch I sent in was wrong, and a '0' was instead of a '-1'. Because of this, vi does behave the wrong way. So again, it should be the last patch for vi. This is for pre7. git-svn-id: svn://busybox.net/trunk/busybox@8422 69ca8d6d-28ef-0310-b511-8ec308f3f277