aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * libbb: make is_suffixed_with() return pointer inside string, not key.Denys Vlasenko2015-08-251-2/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: add is_suffixed_with() functionBartosz Golaszewski2015-08-252-0/+34
| | | | | | | | | | Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ping: fix recently introduced build breakage for non-optimizing buildsDenys Vlasenko2015-08-251-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: add a comment describing the way is_prefixed_with() worksBartosz Golaszewski2015-08-251-0/+5
| | | | | | | | | | Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: add unit tests for is_prefixed_with()Bartosz Golaszewski2015-08-251-0/+19
| | | | | | | | | | | | | | Test corner cases too like looking for an empty prefix etc. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * login: don't print motd if .hushlogin exists in users homeSören Tempel2015-08-241-1/+2
| | | | | | | | | | | | | | | | function old new delta login_main 978 996 +18 Signed-off-by: Sören Tempel <soeren@soeren-tempel.net> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dmesg: add -r option to print raw format even when FEATURE_DMESG_PRETTY is ↵Peter Korsgaard2015-08-241-3/+5
| | | | | | | | | | | | | | | | | | | | enabled Similar to the "big" util-linux version. For !DMESG_PRETTY, the option is accepted (but ignored) as well, for compatibility reasons. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ifupdown: 'prio' should have been 'metric' in static_up and static_up6Alex Dowad2015-08-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a static interface with explicit gateway and metric in /etc/network/interfaces is enabled using 'ifup', and further, the BusyBox 'ip' applet is enabled, the following error message appears at the console (and no default route is added): ip: either "to" is duplicate, or "prio" is garbage Tracing ifup reveals that it is attempting to run the following shell command: ip route add default via <GW> dev <DEVICE> prio <METRIC> 'ip' does not understand the 'prio' argument, causing this error. With 'metric', it works fine. Signed-off-by: Alex Dowad <alexinbeijing@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: add setsockopt_foo helpersDenys Vlasenko2015-08-2416-61/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta setsockopt_int - 23 +23 do_load 918 934 +16 setsockopt_SOL_SOCKET_int - 14 +14 setsockopt_keepalive - 10 +10 setsockopt_SOL_SOCKET_1 - 10 +10 buffer_fill_and_print 169 178 +9 setsockopt_1 - 8 +8 nfsmount 3560 3566 +6 redirect 1277 1282 +5 tcpudpsvd_main 1782 1786 +4 d6_send_kernel_packet 272 275 +3 i2cget_main 380 382 +2 ed_main 2544 2545 +1 scan_recursive 380 378 -2 nbdclient_main 492 490 -2 hash_find 235 233 -2 cmdputs 334 332 -2 parse_command 1443 1440 -3 static.two 4 - -4 ntpd_main 1039 1035 -4 const_int_1 4 - -4 const_IPTOS_LOWDELAY 4 - -4 RCVBUF 4 - -4 ntp_init 474 469 -5 change_listen_mode 316 310 -6 uevent_main 416 409 -7 arping_main 1697 1690 -7 telnet_main 1612 1603 -9 socket_want_pktinfo 42 33 -9 setsockopt_reuseaddr 21 10 -11 setsockopt_broadcast 21 10 -11 httpd_main 772 757 -15 get_remote_transfer_fd 109 94 -15 make_new_session 503 487 -16 ftpd_main 2177 2160 -17 read_bunzip 1896 1866 -30 common_traceroute_main 4099 4058 -41 common_ping_main 1836 1783 -53 ------------------------------------------------------------------------------ (add/remove: 5/4 grow/shrink: 8/21 up/down: 111/-283) Total: -172 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Merge setsockopt error messagesDenys Vlasenko2015-08-243-6/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * traceroute: fix help textDenys Vlasenko2015-08-241-32/+34
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Makefile: add missing libraries to LDLIBSBartosz Golaszewski2015-08-171-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Static build with CONFIG_PAM fails on Debian Jessie due to undefined references to libdl and libaudit. Static build without pam, but with libcrypt required fails as well due to undefined references to libpthread. Fix these two cases by adding the missing libraries to LDLIBS when appropriate. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unit-tests: remove code depending on WANT_TIMINGBartosz Golaszewski2015-08-171-27/+3
| | | | | | | | | | | | | | | | | | | | Since there is no interest in merging a config option for WANT_TIMING, remove the parts of code depending on it altogether. While we're at it: add some newlines to improve readability. Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * unit-tests: remove unnecesary field from struct bbunit_listelemBartosz Golaszewski2015-08-172-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the initial submission struct bbunit_listelem was manipulated by custom list functions implemented in bbunit.c. Since the tests are now added to the list by llist_add_to_end(), which allocates the llist_t objects behind the scenes, there's no need for the *next field. function old new delta unit_main 142 141 -1 bbunit_strrstr_elem 24 16 -8 bbunit_obscure_weak_pass_elem 24 16 -8 bbunit_obscure_strong_pass_elem 24 16 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/4 up/down: 0/-25) Total: -25 bytes Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * arping: make help text clearerDenys Vlasenko2015-08-161-12/+11
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * less: fix botched attempt to use last columnRon Yorston2015-08-161-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 1ecb996 attempted to make read_lines() use the last column of the terminal (as re_wrap() did). There were two problems with this: - The size of the buffer allocated for lines wasn't increased to allow for the extra character. - The test for width overflow was moved after the point where the next character was added to the buffer. This caused a buffer overflow in certain circumstances. For example, if the line beyond the end of the display was wider than the display read_lines() would initially read the partial line into a buffer. When the user moved down read_lines() would be called again to ensure the rest of the line was read. This would place the next character in the partial line before checking for overflow. This can be fixed by moving the test for overflow back to where it was before commit 1ecb996 and changing the comparison to `>` rather than `>=`. There are two other places where buffers are created without allowing for width+1 characters. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ipcalc: fix trivial usage messageRon Yorston2015-08-151-1/+2
| | | | | | | | | | Signed-off-by: Ron Yorston <rmy@frippery.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * zcip: tweak comments and make unsigned division more obviousDenys Vlasenko2015-08-041-9/+6
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * zcip: another code shrinkDenys Vlasenko2015-08-041-159/+148
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta send_arp_request - 185 +185 zcip_main 1273 1272 -1 pick_nip 40 - -40 arp 185 - -185 ------------------------------------------------------------------------------ (add/remove: 1/2 grow/shrink: 0/1 up/down: 185/-226) Total: -41 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * zcip: code shrinkDenys Vlasenko2015-08-041-78/+59
| | | | | | | | | | | | | | function old new delta zcip_main 1263 1230 -33 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: fix implementation of '%z' in strftimeRon Yorston2015-10-131-0/+27
| | | | | | | | | | | | | | | | Windows' strftime prints the name of the timezone rather than the timezone offset for '%z'. Add a hack to do it properly. Windows' strftime also uses its own version of the timezone name for '%Z'. A workaround for this is to set the TZ environment variable.
* | 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>