Fix highlighting of redirection to - (close file descriptor)

Fixes #6092
This commit is contained in:
Johannes Altmanninger
2019-09-12 20:03:46 +02:00
committed by Mahmoud Al-Qudsi
parent 77ef2ef6c3
commit 0ecfc25961

View File

@@ -992,8 +992,12 @@ void highlighter_t::color_redirection(tnode_t<g::redirection> redirection_node)
path_apply_working_directory(target, this->working_directory);
switch (*redirect_type) {
case redirection_type_t::fd: {
int fd = fish_wcstoi(target.c_str());
target_is_valid = !errno && fd >= 0;
if (target == L"-") {
target_is_valid = true;
} else {
int fd = fish_wcstoi(target.c_str());
target_is_valid = !errno && fd >= 0;
}
break;
}
case redirection_type_t::input: {