mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
Fish: bugfix (#1403)
This commit is contained in:
@@ -5,7 +5,7 @@ is simple but incompatible with other shell languages."
|
||||
HOMEPAGE="http://ridiculousfish.com/shell/"
|
||||
COPYRIGHT="2005-2017 Axel Liljencrantz"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="1"
|
||||
REVISION="2"
|
||||
SOURCE_URI="https://github.com/fish-shell/fish-shell/releases/download/$portVersion/fish-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="7ee5bbd671c73e5323778982109241685d58a836e52013e18ee5d9f2e638fdfb"
|
||||
SOURCE_DIR="fish-$portVersion"
|
||||
|
||||
@@ -22,5 +22,84 @@ index 533b3df..852f4a1 100644
|
||||
else
|
||||
echo (_ 'No open utility found. Try installing "xdg-open" or "xdg-utils".')
|
||||
end
|
||||
--
|
||||
2.10.0
|
||||
--
|
||||
2.10.0
|
||||
|
||||
From 6841de5e4b68581ab894c1f1adef97daf6bce90a Mon Sep 17 00:00:00 2001
|
||||
From: Kurtis Rader <krader@skepticism.us>
|
||||
Date: Sun, 4 Jun 2017 21:01:26 -0700
|
||||
Subject: [PATCH] work around Haiku stdio bug
|
||||
|
||||
The Haiku stdio library has a bug. If we set stdout to unbuffered and it
|
||||
is attached to a tty it discards wide output. Given how we interact with
|
||||
the tty it should be safe to replace the problematic `fputwc()` calls
|
||||
with simple `write()` calls. This does depend on the rest of the fish
|
||||
code that writes to the tty to ultimately call write() which is true at
|
||||
this time and should remain true in the future.
|
||||
|
||||
Fixes #4100
|
||||
---
|
||||
src/path.cpp | 3 +--
|
||||
src/reader.cpp | 8 ++++----
|
||||
2 files changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/path.cpp b/src/path.cpp
|
||||
index 1888228d0..e76ed2726 100644
|
||||
--- a/src/path.cpp
|
||||
+++ b/src/path.cpp
|
||||
@@ -4,7 +4,6 @@
|
||||
#include "config.h" // IWYU pragma: keep
|
||||
|
||||
#include <errno.h>
|
||||
-#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
@@ -240,7 +239,7 @@ static void maybe_issue_path_warning(const wcstring &which_dir, const wcstring &
|
||||
debug(0, _(L"The error was '%s'."), strerror(saved_errno));
|
||||
debug(0, _(L"Please set $%ls to a directory where you have write access."), env_var);
|
||||
}
|
||||
- fputwc(L'\n', stderr);
|
||||
+ write(STDERR_FILENO, "\n", 1);
|
||||
}
|
||||
|
||||
static void path_create(wcstring &path, const wcstring &xdg_var, const wcstring &which_dir,
|
||||
diff --git a/src/reader.cpp b/src/reader.cpp
|
||||
index 55796eebd..ebd10681c 100644
|
||||
--- a/src/reader.cpp
|
||||
+++ b/src/reader.cpp
|
||||
@@ -693,14 +693,14 @@ void reader_write_title(const wcstring &cmd, bool reset_cursor_position) {
|
||||
for (size_t i = 0; i < lst.size(); i++) {
|
||||
fputws(lst.at(i).c_str(), stdout);
|
||||
}
|
||||
- fputwc(L'\a', stdout);
|
||||
+ write(STDOUT_FILENO, "\a", 1);
|
||||
}
|
||||
|
||||
proc_pop_interactive();
|
||||
set_color(rgb_color_t::reset(), rgb_color_t::reset());
|
||||
if (reset_cursor_position && !lst.empty()) {
|
||||
// Put the cursor back at the beginning of the line (issue #2453).
|
||||
- fputwc(L'\r', stdout);
|
||||
+ write(STDOUT_FILENO, "\r", 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1284,7 +1284,7 @@ static void reader_flash() {
|
||||
}
|
||||
|
||||
reader_repaint();
|
||||
- fputwc(L'\a', stdout);
|
||||
+ write(STDOUT_FILENO, "\a", 1);
|
||||
|
||||
pollint.tv_sec = 0;
|
||||
pollint.tv_nsec = 100 * 1000000;
|
||||
@@ -3216,7 +3216,7 @@ const wchar_t *reader_readline(int nchars) {
|
||||
reader_repaint_if_needed();
|
||||
}
|
||||
|
||||
- fputwc(L'\n', stdout);
|
||||
+ write(STDOUT_FILENO, "\n", 1);
|
||||
|
||||
// Ensure we have no pager contents when we exit.
|
||||
if (!data->pager.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user