| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
| |
Remove the check for argv being NULL in spawnveq. It shouldn't
ever succeed.
|
|
|
|
|
|
| |
The function find_executable is more generic than needed here: it
can search for all matches on PATH whereas we only want the first.
Implement find_first_executable to do that.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Simplify how scripts are detected by parse_interpreter. It now:
- uses strtok to parse the line buffer;
- returns any options as a single string, not an array of separate options;
- returns both the full path of the interpreter and its name.
When a script is detected the sequence is now:
- if the path to the interpreter refers to an executable run that;
- else look up the interpreter name as a applet (if so configured) and
run the applet found;
- else search for the interpreter name on PATH.
|
|
|
|
|
|
|
|
| |
Add a function (has_exe_suffix) to replace explicit code to check
if a filename ends with '.exe. or '.com'.
Also shrink code that checks for '.exe' or '.com' on PATH in shell's
find_command function.
|
|
|
|
|
|
|
|
|
|
| |
The function signatures were inherited from Git's source code, but are
inconsistent with the declarations in the POSIX standard.
This requires quite a few changes in quite a few callers, unfortunately.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ron Yorston <rmy@pobox.com>
|
|
|
|
|
|
| |
When spawning a process the file should be executed directly if its
filename contains any path separator, not just if it's an absolute
path.
|
|
|
|
|
| |
Upstream BusyBox allows PREFER_APPLETS and SH_STANDALONE to be set
independently. Allow such configurations to work in busybox-w32.
|
|
|
|
|
|
|
| |
The original WIN32 code used the BUSYBOX_APPLET_NAME environment variable
to pass the applet name to the spawned process. This was based on the
(apparently) mistaken idea that WIN32 would replace argv[0] with the
path to the executable.
|
|
|
|
|
|
|
|
|
|
| |
Previously spawn was returning a process handle which was treated as a
pid in certain circumstances. This resulted in the following failing:
find . -type f | sed xargs -n 1 sed -n '1 p'
It should output the first line of each file but stopped after the
first.
|
|
|
|
|
|
|
|
| |
Make mingw_spawn_applet and mingw_spawn_1 static.
The return value from spawnve is an exit code in synchronous mode
and a process handle in asynchronous mode. Pass these upwards
without interpretation.
|
|
|
|
|
|
|
|
| |
Correctly handle the case where an argument needs to be quoted
and has a backslash as its last character.
The issue was detected by the test "sed a cmd ended by double backslash"
in the BusyBox test suite.
|
| |
|
|
|
|
|
| |
The third argument should be int. We only support positive pid
values.
|
| |
|
| |
|
|
|
|
| |
_cwait requires a process handle, not a pid.
|
|
|
|
|
|
|
| |
Conflicts:
debianutils/which.c
editors/vi.c
libbb/executable.c
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* We only need to quote an argument if it contains whitespace.
* There's no point in quoting ? or * because Windows still expands
them. Anyhow, if the command line comes from a BusyBox shell it will
usually have handled the globbing, so we should turn off Windows
globbing for any wildcard that has made it through the shell without
expansion. This means that BusyBox commands run from cmd.exe won't do
wildcard expansion, though.
* Backslashes only need to be doubled if they occur immediately before
double quotes.
* Double quotes need to be escaped with a backslash.
|
|
|
|
|
|
|
|
|
|
|
| |
There are two changes here. The first, in mingw_spawn_1, removes
a post-increment of argv which should have no effect. The second,
in mingw_spawn, should fix a reported problem with xargs:
https://github.com/pclouds/busybox-w32/issues/19
Basically, 'find . -type f | xargs md5sum' was failing to process the
first file.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
On Linux, procps_scan() relies on /proc, which is obviously
unavailable on Windows.
This implementation currently supports procps_status_t.{pid,comm} only.
|
| |
|
| |
|
|
|
|
|
|
| |
Most of this was extracted from commit
e56b799d6ad8afba4168fffa7218d44c041a72d2
in Git repository.
|
|
|