| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
mingw-w64 has its own mempcpy. And even if it didn't upstream
BusyBox has one too. So we definitely don't need our own.
|
|
|
|
|
|
|
| |
I bet this has been fixed in gnulib, too.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ron Yorston <rmy@pobox.com>
|
|
|
|
|
|
|
|
| |
The libbb.h header implicitly includes mingw.h, which has the
declaration of that function.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ron Yorston <rmy@pobox.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It would be more straight-forward to simply #include "libbb.h" which
includes a #define getenv mingw_getenv, but that header also defines
isprint() to a function that is nowhere to be found, leading to link
problems.
So let's go the easy route.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ron Yorston <rmy@pobox.com>
|
|
|
|
|
| |
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ron Yorston <rmy@pobox.com>
|
|
|
|
|
|
|
|
| |
This was inherited from gnulib. While at it, get rid of the ugly (and
unneeded) LOCALE constants.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ron Yorston <rmy@pobox.com>
|
|
|
|
|
|
|
|
|
|
| |
When `#include`ing libbb.h, it implicitly includes mingw.h (with a
prototype for strptime()) and it also defines
_POSIX_THREAD_SAFE_FUNCTIONS so that the time.h header declares
localtime_r().
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ron Yorston <rmy@pobox.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The `tend` variable is only ever initialized and used if the timeout is
*not* infinite.
However, GCC is not smart enough to figure that out. So just initialize
the variable to 0 and be done with it already.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Ron Yorston <rmy@pobox.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
The functions copy_environ and free_environ became unused following
commit ac181bf54 "win32: simplify spawning applets".
|
|
|
|
| |
Rewrite mingw_system using mingw_spawn_proc. Also fix return values.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are plenty of warnings that were not detected in Git's source
code, due to some warnings being turned off in Git's build by default
(even with DEVELOPER=1).
The warnings fall into three categories:
- constants being tested via `#if <name>` instead of `#ifdef <name>`
- unused function parameters
- one instance of an unnecessarily-shadowing variable
This patch fixes all of them.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 909696f13 (win32: Import regex source, 2010-04-14), Git's
compat/regex/ was imported wholesale, with one change (to avoid
redefining _GNU_SOURCE).
For the record, the git.git commit mentioned in that commit message
refers to a transient commit made to git.git's `next` branch which is
rewound with every major Git version, therefore it is long gone. Also
for the record, the correct reference would be: 3632cfc2487 (Use
compatibility regex library for OSX/Darwin, 2008-09-07), i.e. the
compat/regex/ source code as of Git v1.6.0.2.
This commit updates the regex source code to that of Git v2.13.2, or
bd8f0055836 (regex: fix a SIZE_MAX macro redefinition warning,
2016-06-07) in git.git.
Instead of the original fixup to avoid redefining _GNU_SOURCE, we now
require these changes relative to Git's source code:
> diff --git a/win32/regex.c b/win32/regex.c
> index 5cb23e5d5..95e5d757a 100644
> --- a/win32/regex.c
> +++ b/win32/regex.c
> @@ -18,9 +18,11 @@
> Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301 USA. */
>
> -#ifdef HAVE_CONFIG_H
> -#include "config.h"
> -#endif
> +#define HAVE_LIBINTL_H 0
> +#define ENABLE_NLS 0
> +#define HAVE_ALLOCA 0
> +#define NO_MBSUPPORT 1
> +#define GAWK 1
>
> /* Make sure no one compiles this code with a C++ compiler. */
> #ifdef __cplusplus
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
|
|
|
|
|
| |
vfprintf is used in ash_vmsg. It should be passed through the
codepage conversion in winansi.c.
|
|
|
|
| |
Don't expect sleeping for fractions of a second to be very accurate.
|
|
|
|
|
| |
If the environment variable BB_SKIP_ANSI_EMULATION is set (the value
doesn't matter) escape sequences are passed through to the terminal.
|
| |
|
|
|
|
|
|
|
| |
vsnprintf can return -1. I've seen it do this when writing to a small
buffer while vsnprintf(NULL, 0, ...) returns a valid length. I'd prefer
not to rely on the latter working with arbitrary old Windows runtimes
so just skip ANSI emulation if -1 is returned.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
tail failed to process input from a pipe correctly:
$ echo -n 54321 | tail -c 3
543
It was trying to use lseek as an optimisation but WIN32 lseek doesn't
return an error whan applied to a pipe. Fix this by providing a wrapper
for lseek.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Recent changes to make the Windows console behave more like a *nix
terminal didn't work too well for vi/less. On *nix the terminal
buffer can't be scrolled while such screen-based applications are
running. In the Windows console this remained possible and led to
confusion.
Add a new routine to allow vi/less to revert to their previous
behaviour where the cursor is positioned at the top of the buffer
and the entire buffer is cleared.
|
|
|
|
|
|
| |
When a normal *nix terminal has been scrolled back through its
buffer, any keypress will return to the cursor position. Add code
to lineedit.c to do the same for the Windows console.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various tasks on the shell command line (e.g. backspace, DEL,
reverse search) were found to be slow when the console screen
buffer was very large. This was because the entire buffer was
being cleared in erase_till_end_of_screen().
Rewrite erase_till_end_of_screen() to only clear to the end of the
visible screen and to be tidier. (Based on a suggestion by GitHub
user avih.)
Also, modify move_cursor to use coordinates relative to the current
display (as ANSI escapes expect) rather than relative to the screen
buffer.
|
|
|
|
|
|
|
|
| |
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 WIN32 calls should be passed the root directory of the filesystem.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Make 'ls c:' and 'ls c:/*' do the right thing.
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Import inet_pton from gnulib and enable IPv6 support by default.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Commit fa147bd 'Use putenv to implement unsetenv/clearenv' allowed
BusyBox to run on ReactOS but broke it on Windows XP so it was
reverted.
It turns out that the same change is required on 64-bit Windows.
Reinstate the 'safe' environment manipulation code but make it a
configuration option. Add a config file for 64-bit Windows that
does the right thing.
|
|
|
|
|
| |
The third argument should be int. We only support positive pid
values.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
_cwait requires a process handle, not a pid.
|
|
|
|
|
| |
This makes it possible to enable the id and groups applets,
though the results they return are worthless.
|