aboutsummaryrefslogtreecommitdiffhomepage
path: root/expand.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-08 18:40:50 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-07-08 18:40:50 -0700
commit24059924b142744e3edfd61d31af9dafb27f78e2 (patch)
treef0895a29afc3f932922a97144a22c2cd13a04ef7 /expand.cpp
parentbb100a2511fe9a457e424fd14cfafd7b09c002bb (diff)
Unescape characters before calling parser.error
Diffstat (limited to 'expand.cpp')
-rw-r--r--expand.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/expand.cpp b/expand.cpp
index 0d4c84cb..26b6e2d5 100644
--- a/expand.cpp
+++ b/expand.cpp
@@ -715,10 +715,17 @@ void expand_variable_error( parser_t &parser, const wchar_t *token, int token_po
default:
{
+ wchar_t token_stop_char = token[stop_pos];
+ // Unescape (see http://github.com/fish-shell/fish-shell/issues/50)
+ if (token_stop_char == ANY_CHAR)
+ token_stop_char = L'?';
+ else if (token_stop_char == ANY_STRING || token_stop_char == ANY_STRING_RECURSIVE)
+ token_stop_char = L'*';
+
parser.error( SYNTAX_ERROR,
error_pos,
COMPLETE_VAR_DESC,
- token[stop_pos] );
+ token_stop_char );
break;
}
}