aboutsummaryrefslogtreecommitdiffhomepage
path: root/expand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'expand.cpp')
-rw-r--r--expand.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/expand.cpp b/expand.cpp
index c6e85191..9e19cec0 100644
--- a/expand.cpp
+++ b/expand.cpp
@@ -1351,22 +1351,13 @@ static wchar_t * expand_tilde_internal_compat( wchar_t *in )
void expand_tilde( wcstring &input)
{
- if( input[0] == L'~' )
+ if( ! input.empty() && input.at(0) == L'~' )
{
- input[0] = HOME_DIRECTORY;
+ input.at(0) = HOME_DIRECTORY;
expand_tilde_internal( input );
}
}
-wchar_t * expand_tilde_compat( wchar_t *input )
-{
- if (input[0] == L'~') {
- input[0] = HOME_DIRECTORY;
- return expand_tilde_internal_compat(input);
- }
- return input;
-}
-
/**
Remove any internal separators. Also optionally convert wildcard characters to
regular equivalents. This is done to support EXPAND_SKIP_WILDCARDS.