summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* | config: add a comment to indicate WIN32 settingsRon Yorston2019-04-051-0/+2
| |
* | Merge branch 'busybox' into mergeRon Yorston2019-04-044-2325/+2191
|\|
| * vi: revert change in how "end of file list" is deteced - fixes 'q' in bare "vi"Denys Vlasenko2019-04-031-2/+2
| | | | | | | | | | | | | | | | | | | | function old new delta vi_main 273 272 -1 colon 2853 2852 -1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-2) Total: -2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: code shrinkDenys Vlasenko2019-04-031-7/+12
| | | | | | | | | | | | | | function old new delta new_screen 84 75 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: avoid build failure in non-default caseRon Yorston2019-04-031-16/+16
| | | | | | | | | | | | | | | | | | If vi is built with FEATURE_VI_USE_SIGNALS disabled and FEATURE_VI_WIN_RESIZE enabled new_screen() is used without a declaration. Move the function to avoid this. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fsync,sync: merge into one source moduleDenys Vlasenko2019-04-022-81/+61
| | | | | | | | | | | | | | | | | | | | | | With FEATURE_SYNC_FANCY not set: function old new delta fsync_main 130 123 -7 With FEATURE_SYNC_FANCY set, should be much larger code size savings. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * fsync,sync: make them similarDenys Vlasenko2019-04-022-27/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sync: add O_NOCTTY fsync: drop O_NOATIME, add O_NONBLOCK, set exitcode to 1 if fsync() fails, update --help message to be similar to sync. both: reformat code to minimize "diff -u sync.c fsync.c": in particular, they use same open() flags now function old new delta fsync_main 126 130 +4 packed_usage 33316 33317 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 5/0) Total: 5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: distinguish 'wait -n' from other bashismsRon Yorston2019-04-021-7/+8
| | | | | | | | | | | | | | | | Add a specific define to indicate which bash compatibility code implements 'wait -n'. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: rename save_argc -> cmdline_filecntDenys Vlasenko2019-04-021-17/+16
| | | | | | | | | | | | | | | | function old new delta vi_main 272 273 +1 colon 2852 2853 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: restore capability to remember insertion cmds for "."Denys Vlasenko2019-04-021-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta modifying_cmds 17 22 +5 get_one_char 103 98 -5 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 5/-5) Total: 0 bytes text data bss dec hex filename 982121 485 7296 989902 f1ace busybox_old 982094 485 7296 989875 f1ab3 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: code shrinkDenys Vlasenko2019-04-011-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta get_input_line 172 175 +3 char_insert 444 447 +3 rawmode 36 24 -12 edit_file 644 626 -18 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/2 up/down: 6/-30) Total: -24 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: convert more /**/ comments to //Denys Vlasenko2019-04-011-62/+56
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: code shrinkDenys Vlasenko2019-04-011-30/+28
| | | | | | | | | | | | | | | | | | | | | | function old new delta get_one_char 108 103 -5 edit_file 651 644 -7 do_cmd 4696 4688 -8 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-20) Total: -20 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: use vsnprintf to format status lineDenys Vlasenko2019-04-011-27/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | This is the last use of "vsprintf" in busybox: function old new delta status_line_bold 72 77 +5 status_line 40 45 +5 vsprintf 23 - -23 ------------------------------------------------------------------------------ (add/remove: 0/2 grow/shrink: 2/0 up/down: 10/-23) Total: -13 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: rearrange functions, no logic changesDenys Vlasenko2019-04-011-1508/+1407
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: rearrange functions, no logic changesDenys Vlasenko2019-04-011-276/+276
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: rearrange functions, no logic changesDenys Vlasenko2019-04-011-42/+42
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: rearrange functions, no logic changesDenys Vlasenko2019-04-011-74/+75
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: rearrange functions, no logic changesDenys Vlasenko2019-04-011-260/+258
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: fix ^Z not always working as intendedDenys Vlasenko2019-04-011-25/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta tstp_handler 64 71 +7 text_yank 54 56 +2 vi_main 280 272 -8 do_cmd 4705 4696 -9 colon 2861 2852 -9 cont_handler 66 - -66 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 2/3 up/down: 9/-92) Total: -83 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: install SIGINT handler _after_ restart setjmp is initializedDenys Vlasenko2019-04-011-63/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While at it, sanitized comment style, deleted wrong ones, renamed signal handlers to <sig>_handler(), slightly optimized "cursor home+clear screen". function old new delta cont_handler - 66 +66 tstp_handler - 64 +64 winch_handler - 60 +60 int_handler - 32 +32 edit_file 648 651 +3 redraw 52 43 -9 catch_sig 32 - -32 winch_sig 60 - -60 suspend_sig 64 - -64 cont_sig 66 - -66 ------------------------------------------------------------------------------ (add/remove: 4/4 grow/shrink: 1/1 up/down: 225/-231) Total: -6 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: try to make working directory names consistentRon Yorston2019-04-023-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Standardise the path names used for the current working directory by: - resolving with realpath(3); - making the drive name or host name uppercase. The first only really works for physical drives; results for mapped drives are patchy. The standardisation is applied in two places: - at the end of updatepwd() in ash; - when a symbolic link is resolved in mingw_chdir().
* | win32: track current directory of mapped drivesRon Yorston2019-04-011-4/+7
| | | | | | | | | | | | | | | | | | | | | | Drives mapped to a network share or path didn't have their current directory tracked when using path names of the form 'c:path'. This was because commit 585d17d26 used realpath(3) to canonicalise paths in chdir(2). Use readlink(2) instead so that mapped drives aren't canonicalised but symlinks are resolved. See GitHub issue #147.
* | df: display origin of mapped driveRon Yorston2019-04-014-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When a drive is mapped to a network share or a path display the mapping in the 'Filesystem' column of df's output. Since this changes the mnt_fsname field of the mntent structure a slight alteration is needed to print_all_cwd() in ash. Revert the change in commit a8c63f25b that enabled FEATURE_DF_FANCY in the default configuration. None of the additional options is very useful. See GitHub issue #164.
* | win32: fix compilation error; update default configurationsRon Yorston2019-03-313-2/+5
| |
* | Merge branch 'busybox' into mergeRon Yorston2019-03-3116-140/+299
|\|
| * blockdev: code shrinkDenys Vlasenko2019-03-301-81/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta bdcmd_names - 82 +82 bdcmd_ioctl - 44 +44 bdcmd_flags - 11 +11 blockdev_main 273 258 -15 bdcommands 176 - -176 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 0/1 up/down: 137/-191) Total: -54 bytes text data bss dec hex filename 982326 485 7296 990107 f1b9b busybox_old 982272 485 7296 990053 f1b65 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ip: Fix ip -o linkStefan Sørensen2019-03-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Commit db169f253854db572c0c2b7e3d74ebbe6afdb97f breaks the "ip -o link" command, no output is displayed.. Fix by only excluding the link info if in oneline mode and if the address family is not AF_PACKET. function old new delta ipaddr_list_or_flush 1232 1202 -30 Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: allow manual screen update if SIGWINCH isn't supportedRon Yorston2019-03-301-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On platforms that don't support SIGWINCH vi can be configured with FEATURE_VI_USE_SIGNALS disabled and FEATURE_VI_WIN_RESIZE enabled. This allows the user to force an update with ^L when the screen is resized. However, because the SIGWINCH handler hasn't run the virtual screen buffer won't have been updated and the display becomes corrupted. Fix this by calling new_screen() if necessary. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * man: add "/usr/share/man" as another default MANPATH, fix col overrideDenys Vlasenko2019-03-301-20/+13
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta static.mpl - 12 +12 packed_usage 33307 33316 +9 man_main 857 851 -6 add_MANPATH 148 138 -10 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 1/2 up/down: 21/-16) Total: 5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: mark scripted_main() as externally visibleRon Yorston2019-03-302-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Building with individual binaries enabled fails when embedded script applets are included: /tmp/ccIvMFZg.o: In function `main': applet.c:(.text.main+0x20): undefined reference to `scripted_main' Mark scripted_main() as externally visible. Reported-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * vi: code shrink, proper printf formatting for strlen()Denys Vlasenko2019-03-291-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta yank_delete 98 99 +1 what_reg 34 33 -1 text_yank 56 54 -2 end_cmd_q 17 14 -3 do_cmd 4718 4705 -13 colon 2875 2861 -14 edit_file 668 648 -20 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/6 up/down: 1/-53) Total: -52 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: fix "wait -n" to wait for a _job_, not a _process_Denys Vlasenko2019-03-271-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | function old new delta checkjobs 163 183 +20 process_wait_result 449 463 +14 leave_var_nest_level 98 107 +9 enter_var_nest_level 32 38 +6 set_vars_and_save_old 147 150 +3 builtin_local 53 56 +3 builtin_wait 322 323 +1 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 7/0 up/down: 56/0) Total: 56 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ash: add "wait -n" bashismDenys Vlasenko2019-03-271-6/+47
| | | | | | | | | | | | | | | | | | | | function old new delta waitcmd 205 288 +83 dowait 405 444 +39 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 122/0) Total: 122 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ntpd: do not create pid file if not backgroundedDenys Vlasenko2019-03-271-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | function old new delta ntp_init 995 1021 +26 ntpd_main 1267 1257 -10 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 26/-10) Total: 16 bytes Reported by Alfonso Ranieri <alforan@tin.it> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * hush: add "wait -n" bashismDenys Vlasenko2019-03-261-1/+17
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * man: don't skip default path which appears in config fileRon Yorston2019-03-261-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the MANPATH environment variable isn't set a provisional default path of /usr/man is placed in man_path_list. This is only used if a configuration file doesn't contain an alternative path. If a configuration file lists the default path first: MANPATH /usr/man:/usr/share/man add_MANPATH() sees that the default entry is already present and skips it. As a result man_path_list only contains the second and subsequent components of the configured MANPATH. In such cases the path should not be skipped. function old new delta add_MANPATH 170 183 +13 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/0 up/down: 13/0) Total: 13 bytes Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ts: do call localtime() when neither -s nor -i specifiedDenys Vlasenko2019-03-261-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ts: use gettimeofday - we don't use nanoseconds hereDenys Vlasenko2019-03-261-13/+9
| | | | | | | | | | | | | | function old new delta ts_main 398 376 -22 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ts: replace overlapping strcpy with shorter codeDenys Vlasenko2019-03-261-1/+2
| | | | | | | | | | | | | | function old new delta ts_main 401 398 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ts: fix incorrect (copy-pasted) copyright attributionDenys Vlasenko2019-03-261-4/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * ts: new appletDenys Vlasenko2019-03-261-0/+88
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * do not duplicate CONFIG_PID_FILE_PATH and ".pid" stringsDenys Vlasenko2019-03-178-11/+33
| | | | | | | | | | | | | | | | text data bss dec hex filename 981737 485 7296 989518 f194e busybox_old 981704 485 7296 989485 f192d busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: improved support for c:path path namesRon Yorston2019-03-304-29/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Microsoft Windows permits path names of the form 'c:path', without a path separator after the colon. The system records a current directory for each drive and the path is interpreted relative to that. Since Windows API calls understand 'c:path' path names many commands in busybox-w32 already work with them. This commit adds the following: - The 'cd' shell built-in interprets 'c:path' path names correctly. Previously it treated them as relative to the shell's concept of the current working directory, not the current directory of the specified drive. - The 'pwd' shell built-in takes the '-a' option to list the current directory for all drives. - 'c:path' path names are subject to tab-completion. Paths of the form 'c:path' don't work for mapped network drives or paths that have been associated with a drive using SUBST. See GitHub issue #147.
* | win32: update implementation of setmntent(3)Ron Yorston2019-03-302-4/+7
| | | | | | | | | | | | | | - The arguments to setmntent(3) are unused: add a macro to drop them at call sites. - Allow remote drives.
* | win32: interpret absolute paths as relative to %SYSTEMDRIVE%Ron Yorston2019-03-286-1/+112
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BusyBox contains hardcoded references to absolute paths which are unique in the *nix world but on Microsoft Windows are interpreted as being on the current drive. To make these unique again consider them to be relative to %SYSTEMDRIVE%. Support this by adding functions to: - determine the system drive (not using the environment variable); - change a process's current directory to the root of the system drive; - make relative paths absolute before changing directory (if needed). The following applications have been modified: - ash references /etc/profile from the system drive; - dpkg places its data store on and installs files to the system drive; - rpm installs files to the system drive; - man looks for configuration files and man pages on the system drive. See GitHub issue #158.
* | man: proper handling of default path and config fileRon Yorston2019-03-282-0/+8
| | | | | | | | | | | | | | | | Don't overwrite the default path when the path relative to the executable is added. Remove trailing carriage returns when parsing the configuration file.
* | man: don't skip default path which appears in config fileRon Yorston2019-03-281-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the MANPATH environment variable isn't set a provisional default path of /usr/man is placed in man_path_list. This is only used if a configuration file doesn't contain an alternative path. If a configuration file lists the default path first: MANPATH /usr/man:/usr/share/man add_MANPATH() sees that the default entry is already present and skips it. As a result man_path_list only contains the second and subsequent components of the configured MANPATH. In such cases the path should not be skipped.
* | win32: share code to find root prefix of pathRon Yorston2019-03-234-51/+42
| | | | | | | | | | | | | | Move unc_root_len() from ash to mingw32.c and use it in the new function root_len(), which can be used in make_directory(). This reduces changes to upstream code and saves a few bytes.
* | win32: improve filesystem detection and displayRon Yorston2019-03-206-11/+23
| | | | | | | | | | | | | | | | | | | | Miscellaneous improvements: - Enable '-a' option to display all filesystems in df(1). - Detect the UDF CDROM filesystem and display it in 'stat -f'. - Let getmntent(3) handle CDROM and floppy devices, ignoring those that have no media. - Set number of inodes and filesystem flags to 0 in statfs(2).