Rename function expand_variable_array to tokenize_variable_array and move it from expand.c to common.c, since it is used by fish_pager, which should not depend on expand.o

darcs-hash:20060529111342-ac50b-315d7dcf04e05fa8f32e16801e6793ac4e4e022e.gz
This commit is contained in:
axel
2006-05-29 21:13:42 +10:00
parent 79b466441b
commit d46dade284
9 changed files with 44 additions and 44 deletions

View File

@@ -1403,3 +1403,29 @@ int common_get_height()
return termsize.ws_row;
}
void tokenize_variable_array( const wchar_t *val, array_list_t *out )
{
if( val )
{
wchar_t *cpy = wcsdup( val );
wchar_t *pos, *start;
if( !cpy )
{
die_mem();
}
for( start=pos=cpy; *pos; pos++ )
{
if( *pos == ARRAY_SEP )
{
*pos=0;
al_push( out, start==cpy?cpy:wcsdup(start) );
start=pos+1;
}
}
al_push( out, start==cpy?cpy:wcsdup(start) );
}
}