aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | ash: preserve environment variables with invalid charactersRon Yorston2015-10-011-8/+24
| | | | | | | | | | | | When replacing invalid characters in shell variable names use a copy of the environment variable. This leaves the original variable in the environment so that it can be seen by Windows-native child processes.
* | ash: replace invalid characters in variable names with '_'Ron Yorston2015-09-301-2/+8
| | | | | | | | | | | | Microsoft Windows has environment variables with names like 'ProgramFiles(x86)'. When the environment is imported into the shell replace invalid characters with underscores.
* | win32: append '/' to bare drive name in opendirRon Yorston2015-09-302-0/+21
| | | | | | | | Make 'ls c:' and 'ls c:/*' do the right thing.
* | less: fix bugs in terminal width handlingRon Yorston2015-08-061-14/+14
| |
* | less: port to WIN32 and enable by defaultRon Yorston2015-08-063-20/+104
| |
* | more: WIN32 portRon Yorston2015-08-041-0/+19
| | | | | | | | | | | | | | | | | | This isn't enabled by default because Windows has `more.com` as a pager. Note that enabling `more` also turns on the use of termios for screen manipulation. You'll need to turn that off by going to BusyBox Settings -> BusyBox Library Tuning.
* | Update default configuration after mergeRon Yorston2015-08-042-4/+10
| |
* | Merge branch 'busybox' into mergeRon Yorston2015-08-04153-40334/+433
|\|
| * zcip: simplify codeDenys Vlasenko2015-08-041-139/+96
| | | | | | | | | | | | | | function old new delta zcip_main 1411 1263 -148 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * uname: make OS name configurableRon Yorston2015-08-032-2/+10
| | | | | | | | | | | | | | | | | | | | | | A mailing list thread in September 2013 discussed changing the string returned by the non-POSIX 'uname -o' option. Nothing ever came of this because there was no agreement as to what the string should be. Make the string configurable so that people can decide for themselves. Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: further tweaks to regular file detectionRon Yorston2015-08-031-11/+5
| | | | | | | | | | | | | | | | | | | | | | | | Test explicitly for REOPEN flags: update_num_lines is called unconditionally so (num_lines != NOT_REGULAR_FILE) is also true when num_lines contains a valid number of lines. The call to fstat doesn't need to be in #if ENABLE_FEATURE_LESS_FLAGS: the whole function is already in such a test. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * diff.tests: add testcases for -B and single line changesAaro Koskinen2015-07-311-0/+12
| | | | | | | | | | | | | | Add testcases for -B and single line changes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * diff: fix -B with single line changesAaro Koskinen2015-07-311-2/+2
| | | | | | | | | | | | | | | | Fix -B with single line changes. They were always ignored regardless if they were blank or not. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: improve regular file detection in line counting codeDenys Vlasenko2015-07-311-19/+28
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: allow use of last column of terminalRon Yorston2015-07-311-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When read_lines tests whether a character will fit on the current line it checks the *next* character but in case of overflow doesn't display the *current* one. This results in the last column of the terminal never being used. The test in re_wrap (used when the terminal width changes or line numbers are enabled/disabled) is different: it does allow the use of the final column. function old new delta read_lines 764 770 +6 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 6/0) Total: 6 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: fix line number confusionRon Yorston2015-07-311-37/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Much of the code refers to lines using indices into the flines array (which splits lines into portions that fit on the terminal). In some cases this is wrong and actual line numbers should be used: - when lines are being truncated rather than wrapped (-S flag) - when line numbers have been entered by the user Also fix a bug in numeric input and improve the display at EOF. function old new delta goto_lineno - 111 +111 cap_cur_fline - 101 +101 buffer_to_line - 56 +56 buffer_up 35 66 +31 less_main 2606 2615 +9 goto_match 125 127 +2 buffer_down 81 56 -25 buffer_line 64 - -64 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 3/1 up/down: 310/-89) Total: 221 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: add a function to detect when display is at end of fileRon Yorston2015-07-311-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a function to package the test that detects whether enough has been read from the file to allow a screenful to be displayed. Also use this to determine when to display '(END)' in the status line. The previous code was incomplete and didn't handle truncated lines (-S flag) properly. function old new delta at_end - 63 +63 status_print 111 109 -2 read_lines 819 764 -55 getch_nowait 319 264 -55 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/3 up/down: 63/-112) Total: -49 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: rearrange detection of non-regular filesRon Yorston2015-07-311-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the code to detect non-regular files to the point where the file is being opened. If num_lines == READING_FILE guarantees that the file is regular. Detect when a file becomes unreadable between it first being opened and the call to update_num_lines. Mark the file as being non-regular so we don't try that again. function old new delta reinitialize 197 245 +48 update_num_lines 159 127 -32 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 48/-32) Total: 16 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: move code to count lines into a separate functionRon Yorston2015-07-311-24/+28
| | | | | | | | | | | | | | | | | | | | | | function old new delta update_num_lines - 159 +159 m_status_print 409 266 -143 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/1 up/down: 159/-143) Total: 16 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: fix numeric inputRon Yorston2015-07-311-1/+1
| | | | | | | | | | Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * echo: make escape sequences depend on fancy modeMike Frysinger2015-07-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when you disable fancy echo, escape sequences are hardcoded enabled (e.g. as if you used `echo -e` all the time). The opposite behavior is more desirable (always disable -e support) because: * This seems to contradict the spirit of the kconfig help text (where it says enable support for -n/-e flags), although you could say that we aren't supporting the -e flag directly as `echo -e` will show the -e flag. * POSIX makes escape sequences optional, and even says they are there only on XSI-conformant systems. * It saves space (~100 bytes on x86_64). * It makes things faster! * It makes it behave more like bash where you need an explicit -e flag in order for escape sequences to be interpreted. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fbset: fix rgba parsingLinus Walleij2015-07-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit b5c7220e7b2b6611fe5beca494c67bfe51fcfafb "fbset: respect rgba configuration lines in fb.modes" I somehow managed to swap the offset/length markers around. The man page for fb.modes says it should be offset/length not length/offset as I was accidentally parsing it. As my fb.modes file was also reversed I didn't notice until I tried someone elses fb.modes file. Mea culpa. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * udhcpc: dns labels can actually start with a numberArthur Gautier2015-07-301-4/+0
| | | | | | | | | | | | | | | | | | | | | | While RFC1035 recommends a label not to start with a number, there is actually no such limitation in dns. One may buy a domain name like 0x1.net and use it. This commit remove this check and allow a user to use such domains. Signed-off-by: Arthur Gautier <baloo@gandi.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: improvements to verbose status messagesRon Yorston2015-07-211-14/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make verbose status messages (-m/-M flags) behave more like the real `less` command: - fix display of line numbers so they're correct whether lines are being truncated (-S flag) or wrapped. - don't display total lines or percentage when lines are read from stdin: we don't have that information until we reach EOF. When we do reach EOF the additional information is displayed. - when lines are read from a file count the total number of lines so that we can display percentages. Counting lines is avoided until the information is actually needed. If the user pages to EOF the separate read pass can be avoided entirely. Fixes Bug 7586 function old new delta m_status_print 195 382 +187 safe_lineno - 35 +35 reinitialize 172 182 +10 read_lines 675 685 +10 buffer_fill_and_print 178 169 -9 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 3/1 up/down: 242/-9) Total: 233 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * sync: add support for -d -f FILEDenys Vlasenko2015-07-214-11/+75
| | | | | | | | | | | | | | | | | | | | | | | | Based on the patch by Ari Sundholm <ari@tuxera.com> function old new delta sync_main 20 163 +143 packed_usage 30653 30673 +20 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 163/0) Total: 163 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Remove old_e2fsprogs/*Denys Vlasenko2015-07-19133-40044/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: add a function to make a copy of a region of memoryRon Yorston2015-07-198-17/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a library routine to package the idiom: p = xmalloc(b, n); memcpy(p, b, n); and use it where possible. The example in traceroute used xzalloc but it didn't need to. function old new delta xmemdup - 32 +32 last_main 834 826 -8 make_device 2321 2311 -10 common_traceroute_main 3698 3685 -13 readtoken1 3182 3168 -14 procps_scan 1222 1206 -16 forkchild 655 638 -17 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/6 up/down: 32/-78) Total: -46 bytes Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: correctly account for tabs when rewrapping linesRon Yorston2015-07-191-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Lines are rewrapped when the terminal width changes or line numbers are enabled/disabled. The current calculation always adds eight to the line length for a tab whereas it should only add enough to move to the next tab stop. This doesn't affect the display of lines, which is handled elsewhere and gets tab stops right, but it does cause lines to be wrapped at the wrong position. Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: fix display of line numbersRon Yorston2015-07-191-24/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Line numbers are displayed incorrectly on lines that have a search pattern highlighted. The problem can be fixed by moving the call to lineno_str in print_found above the while loop that alters the value of the line pointer. However, a more substantial rewrite results in savings. function old new delta buffer_print 688 697 +9 .rodata 156077 156045 -32 lineno_str 85 - -85 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 9/-117) Total: -108 bytes Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: document -S flag and make it independently configurableRon Yorston2015-07-191-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The -S flag, to cause long lines to be truncated, was enabled by FEATURE_LESS_DASHCMD. This is non-obvious and -S is useful even if the '-' command isn't enabled. function old new delta .rodata 156045 156077 +32 packed_usage 30223 30244 +21 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 53/0) Total: 53 bytes Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ash: don't convert path delimiters for certain environment variablesRon Yorston2015-07-302-1/+7
| | | | | | | | | | | | | | The SYSTEMROOT and COMSPEC environment variables are known to cause problems for Windows applications if they contain forward slashes rather than backslashes. So don't convert them, even if the -X flag isn't present.
* | win32: remove setitimer implementation and SIGALRM handlingRon Yorston2015-07-262-133/+1
| | | | | | | | | | | | | | Commit 69f49ea imported a setitimer implementation from git. Since setitimer isn't used at all in BusyBox it can be removed. The same technique could be used to implement alarm but nothing in the WIN32 port uses that (yet).
* | winansi: fixes to cursor positioning, screen clearingRon Yorston2015-07-171-4/+15
| | | | | | | | | | | | | | | | | | | | It seems that the cursor positioning escape sequence 'ESC[n;mH' allows n and m values of 0 or 1 to represent the leftmost/topmost position. Allow for this and also fix handling of missing values. When the screen is cleared using FillConsoleOutputCharacterA it's also necessary to make explicit calls to FillConsoleOutputAttribute to reset attributes.
* | mingw: enable support for IPv6Ron Yorston2015-07-155-6/+263
| | | | | | | | Import inet_pton from gnulib and enable IPv6 support by default.
* | win32: silence some compiler warningsRon Yorston2015-07-156-14/+22
| |
* | archival: provide dummy check_errors_in_children for WIN32Ron Yorston2015-07-153-5/+10
| |
* | Remove a couple of commentsRon Yorston2015-07-141-2/+0
| |
* | Merge branch 'busybox' into mergeRon Yorston2015-07-1460-322/+313
|\|
| * ash: use alloca to get rid of setjmpRon Yorston2015-07-131-34/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that the only thing protected by setjmp/longjmp is the saved string, we can allocate it on the stack to get rid of the jump. Based on commit bd35d8e from git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu. function old new delta readtoken1 3182 3116 -66 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-66) Total: -66 bytes Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fix file modeDenys Vlasenko2015-07-131-0/+0
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: remove parsebackquote flagRon Yorston2015-07-133-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 503a0b8 from git://git.kernel.org/pub/scm/utils/dash/dash.git by Herbert Xu says: >The parsebackquote flag is only used in a test where it always has the >value zero. So we can remove it altogether. The first statement is incorrect: parsebackquote is non-zero when backquotes (as opposed to $(...)) are used for command substitution. It is possible for the test to be executed with parsebackquote != 0 in that case. The test is question checks whether quotes have been closed, raising the error "unterminated quoted string" if they haven't. There seems to be no good reason to allow unclosed quotes within backquotes. Bash, hush and dash (after commit 503a0b8) all treat the following as an error: XX=`"pwd` whereas BusyBox ash doesn't. It just ignores the unclosed quote and executes pwd. So, parsebackquote should be removed but not for the reason stated. function old new delta parsebackquote 1 - -1 readtoken1 3222 3182 -40 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-41) Total: -41 bytes Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Removes stray empty line from codeManinder Singh2015-07-1328-46/+0
| | | | | | | | | | | | | | | | | | This patch removes stray empty line from busybox code reported by script find_stray_empty_lines Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Akhilesh Kumar <akhilesh.k@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * applets: Add installation of individual binariesClayton Shotwell2015-07-012-2/+28
| | | | | | | | | | | | | | | | Adding support to install individual binaries if the option is enabled. This also installs the shared libbusybox.so.* library. Signed-off-by: Clayton Shotwell <clshotwe@rockwellcollins.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ps: fix SEGV on narrow screens. closes 8176Denys Vlasenko2015-07-011-5/+7
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ipaddress: better formatting, no code changesDenys Vlasenko2015-07-011-6/+10
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ip addr: support change and replace commandsMichael Tokarev2015-07-012-9/+13
| | | | | | | | | | Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fix whitespacesManinder Singh2015-06-071-1/+1
| | | | | | | | | | | | | | reported by script :- scripts/fix_ws.sh Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fix if(p)/free(p) constructManinder Singh2015-06-074-14/+7
| | | | | | | | | | | | | | | | No need of explicit NULL check before free. Signed-off-by: Maninder Singh <maninder1.s@samsung.com> Signed-off-by: Akhilesh Kumar <akhilesh.k@samsung.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * i2cdetect: use break instead of goto in list_i2c_busses_and_exit()Bartosz Golaszewski2015-06-071-2/+1
| | | | | | | | | | | | | | | | Since there are now more statements in the if block after the while loop in list_i2c_busses_and_exit(), there's no need for a label. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * i2cdump: code reworkBartosz Golaszewski2015-06-071-149/+167
| | | | | | | | | | | | | | | | | | Split i2cdump_main() into shorter functions. Simplify the code a bit. Make block an array of ints so that we can store negative results of read functions (fixes a bug found by Denys Vlasenko). Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>