Migrated off of old variant of expand_one that used halloc

This commit is contained in:
ridiculousfish
2012-01-31 21:30:09 -08:00
parent 409f70c7f3
commit 0b4b6c498d
4 changed files with 63 additions and 114 deletions

View File

@@ -772,7 +772,8 @@ void tokenize( const wchar_t * const buff, int * const color, const int pos, arr
break;
}
wchar_t *target=0;
wcstring target_str;
const wchar_t *target=NULL;
color[ tok_get_pos( &tok ) ] = HIGHLIGHT_REDIRECTION;
tok_next( &tok );
@@ -785,7 +786,10 @@ void tokenize( const wchar_t * const buff, int * const color, const int pos, arr
{
case TOK_STRING:
{
target = expand_one( context, wcsdup( tok_last( &tok ) ), EXPAND_SKIP_CMDSUBST);
target_str = tok_last( &tok );
if (expand_one(target_str, EXPAND_SKIP_CMDSUBST)) {
target = target_str.c_str();
}
/*
Redirect filename may contain a cmdsubst.
If so, it will be ignored/not flagged.