diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-06-02 14:04:25 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-06-02 14:04:25 -0700 |
commit | b7ba2529658e128bfd4b5aacb7702a13c6a9d820 (patch) | |
tree | 3242654c8485d7272e0c2a982193cab921873f18 /expand.cpp | |
parent | ae12e1b5379d8cee2dd87891670536d01dbce45e (diff) |
Restore implicit cd for paths starting with ., .., or ~
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. |