aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-09-30 15:20:54 +0100
committerRon Yorston <rmy@pobox.com>2024-09-30 16:08:42 +0100
commit4be93f32f5bd5ccaac343b4d03fb861a02d6de96 (patch)
tree32692c33609484e03f9b22ae260c1a6e05a6b96c /arch
parent431e2704c17d5c0e51a0cbebfb1105bd4962b3f7 (diff)
downloadbusybox-w32-4be93f32f5bd5ccaac343b4d03fb861a02d6de96.tar.gz
busybox-w32-4be93f32f5bd5ccaac343b4d03fb861a02d6de96.tar.bz2
busybox-w32-4be93f32f5bd5ccaac343b4d03fb861a02d6de96.zip
win32: work around problem with stderr in MSVCRT
Try to run a non-existent command with standard error closed: xyz 2>&- In recent versions of busybox-w32 this resulted in problems with moving through history (either using up/down keys or ctrl-r) and tab completion. In all cases the order of the prompt and the command were reversed. Bisection showed the problem was first seen in PRE-5396 which merged some commits from upstream, including fd47f0567 (lineedit: print prompt and editing operations to stderr). This (eventually) called to mind a previous problem with stderr in xargs which was fixed by commit f192e6539 (xargs: fix 'xargs -sNUM' tests). In both cases it seemed that mixing calls to bb_putchar_stderr() and fprintf(stderr, ...) was at fault. The former uses a file descriptor while the latter uses a stream. It was almost as if the stream was buffered. - The problem with xargs affected 32-bit and 64-bit builds with MSVCRT. - The problem with '2>&-' only affected 32-bit builds with MSVCRT. - Neither problem was present with UCRT builds. As a workaround change bb_putchar_stderr() to use the stderr stream in builds for MSVCRT. Saves 16 bytes in the 32-bit build. (GitHub issue #460)
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions