diff options
Diffstat (limited to 'expand.cpp')
-rw-r--r-- | expand.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -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. |