diff options
author | maxfl <gmaxfl@gmail.com> | 2012-07-08 09:39:39 +0800 |
---|---|---|
committer | maxfl <gmaxfl@gmail.com> | 2012-07-08 09:39:39 +0800 |
commit | e1b8c425da571b7f002103805520a1d496ebb087 (patch) | |
tree | f4a9790adc9ba61f3485e0013b6f958f80a14695 /expand.cpp | |
parent | 5f05756e657d85026026d95d4ada0b6677861900 (diff) |
Fix case when second limit is a variable:
echo $PATH[1..$n]
Diffstat (limited to 'expand.cpp')
-rw-r--r-- | expand.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -735,7 +735,6 @@ static int parse_slice( const wchar_t *in, wchar_t **end_ptr, std::vector<long> // debug( 0, L"parse_slice on '%ls'", in ); - while( 1 ) { long tmp; @@ -761,6 +760,8 @@ static int parse_slice( const wchar_t *in, wchar_t **end_ptr, std::vector<long> pos = end-in; if ( in[pos]==L'.' && in[pos+1]==L'.' ){ pos+=2; + while( in[pos]==INTERNAL_SEPARATOR ) + pos++; long tmp1 = wcstol( &in[pos], &end, 10 ); if( ( errno ) || ( end == &in[pos] ) ) { |