Skip to content

Commit

Permalink
Fix highlighting of redirection to - (close file descriptor)
Browse files Browse the repository at this point in the history
  • Loading branch information
krobelus committed Sep 12, 2019
1 parent 737c2d1 commit f5e96f8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/highlight.cpp
Expand Up @@ -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: {
Expand Down

0 comments on commit f5e96f8

Please sign in to comment.