mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-03 01:41:15 -03:00
Revert "Tighten up empty string checks."
The use of wcstoimax causes certain out-of-range values
to be silently truncated (e.g. when converted to a pid),
and is incompatible with FreeBSD (see #626)
This reverts commit 6faa2f9866.
This commit is contained in:
@@ -13,8 +13,6 @@
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <inttypes.h>
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#include <wchar.h>
|
||||
@@ -1002,8 +1000,8 @@ bool parse_execution_context_t::determine_io_chain(const parse_node_t &statement
|
||||
} else {
|
||||
wchar_t *end = NULL;
|
||||
errno = 0;
|
||||
int old_fd = wcstoimax(target.c_str(), &end, 10);
|
||||
if (old_fd < 0 || errno || *end != L'\0') {
|
||||
int old_fd = fish_wcstoi(target.c_str(), &end, 10);
|
||||
if (old_fd < 0 || errno || *end) {
|
||||
errored =
|
||||
report_error(redirect_node, _(L"Requested redirection to '%ls', which "
|
||||
L"is not a valid file descriptor"),
|
||||
|
||||
Reference in New Issue
Block a user