aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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).
* | win32: change stat(2) error code in certain casesRon Yorston2019-03-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 325fee1f9 (win32: change handling of trailing slashes in stat(2)) caused stat(2) to return EINVAL in some cases when ENOENT might have been more appropriate. This caused the command: rm -f dir/* to report an error when the directory was empty, contrary to its expected behaviour of saying nothing. Fixes GitHub issue #155.
* | winansi: more robust handling of invalid escape sequencesRon Yorston2019-03-191-34/+46
| | | | | | | | | | | | | | | | Commit 399b1dd64 (winansi: support escape sequence to set window title) failed to handle some invalid escape sequences correctly. Make the code more robust. Fixes GitHub issue #153.
* | ash: rewrite PATH update to save a few bytesRon Yorston2019-03-181-12/+8
| |
* | vi: improve reliability of pasted textRon Yorston2019-03-171-2/+2
| | | | | | | | | | Increase the allowed number of outstanding events in the input queue to two.
* | vi: fix spurious error on opening file with CRLF line endingsRon Yorston2019-03-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit 91e49fbc7 (vi: add a function to count CRs in the text buffer) resulted in the spurious error "can't read 'file'" when opening a file with CRLF line endings. This was because the count function was called with an incorrect pointer into the text buffer. The upstream code: p = text_hole_delete(p + cnt, p + size - 1, NO_UNDO); unnecessarily updates the pointer p: it's never used again.
* | Merge branch 'busybox' into mergeRon Yorston2019-03-163-6/+15
|\|
| * Fix off by one error in FAT16 <=> FAT32 detectionThomas Frauendorfer2019-03-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | cluster_count is compared against FAT16_MAX, which is defined as 0xfff4 That is the maximum number of cluster a FAT16 can have. For reference also check the hardware whitepaper from Microsoft FAT: General Overview of On-Disk Format, version 1.03 page 15 Signed-off-by: Thomas Frauendorfer <tf@miray.de> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * watch: support fractional -n SECDenys Vlasenko2019-03-122-5/+14
| | | | | | | | | | | | | | function old new delta watch_main 212 232 +20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | ash: enforce ';' separator in CDPATH and MANPATH variablesRon Yorston2019-03-161-11/+23
| | | | | | | | | | | | | | | | | | | | Commit a23624237 (win32: special treatment for PATH) required the PATH variable to use ';' as the separator between components and enforced this by intercepting attempts to update it. Do the same for the CDPATH and MANPATH variables. Also, fix a case in cdcmd() where the wrong separator was used.
* | ash: set current working directory on startupRon Yorston2019-03-151-0/+7
| | | | | | | | | | | | | | | | | | | | | | When the shell starts behave as though the user had manually changed to the current working directory of the process, but only if it's an interactive, non-login shell and the '-d' flag isn't present. This gives more consistent behaviour when the shell is started in a drive mapped to a network share or a symlinked directory. This completes the changes requested in GitHub issue #148.
* | win32: add function to convert slashes to backslashesRon Yorston2019-03-159-25/+29
| | | | | | | | | | | | | | | | | | There are now two places where slashes are converted to backslashes throughout a string so it makes sense to create a function to do this. To avoid confusion rename convert_slashes() to bs_to_slash() and call the new function slash_to_bs().
* | lineedit: add a command to change backslashes to slashesRon Yorston2019-03-152-6/+7
| | | | | | | | | | | | | | | | | | | | | | When a path name is copied to a console application using drag and drop the path separator is backslash. To handle this situation in the shell add an editing command (Ctrl-Z) to convert all backslashes on the current line to slashes. See GitHub issue #149. Also remove some unused code from read_key().
* | win32: realpath(3): remove trailing slashRon Yorston2019-03-141-1/+4
| | | | | | | | | | | | | | | | | | If the path is that of a drive mapped to a network share _fullpath() leaves the trailing slash on the drive name and it remains present after the call to resolve_symlinks(). Remove a trailing slash from the resolved path unless it's preceded by a colon.
* | su: canonicalise directory before elevating privilegesRon Yorston2019-03-141-5/+11
| | | | | | | | | | | | If the current directory is in a drive mapped to a network share we may not be able to access it once we have elevated privileges. Avoid this by canonicalising the path before calling ShellExecuteEx().
* | Update copyright dateRon Yorston2019-03-142-2/+2
| |
* | win32: consolidate file metadata optionsRon Yorston2019-03-124-20/+6
| | | | | | | | Merge FEATURE_IDENTIFY_OWNER into FEATURE_EXTRA_FILE_DATA.
* | win32: fix POSIX build (again)Ron Yorston2019-03-123-3/+9
| | | | | | | | | | Some faulty logic with ENABLE_FEATURE_EXTRA_FILE_DATA broke the POSIX build.
* | Merge branch 'busybox' into mergeRon Yorston2019-03-1212-51/+55
|\|
| * xargs: mention -E STR in --helpDenys Vlasenko2019-03-101-7/+7
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * scripts/echo.c: resolve implicit declaration of function 'dup2'Nicolas Hüppelshäuser2019-03-051-0/+1
| | | | | | | | | | Signed-off-by: Nicolas Hüppelshäuser <nicolas.hueppelshaeuser@emlix.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * top: tweak --helpDenys Vlasenko2019-02-272-15/+8
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>