aboutsummaryrefslogtreecommitdiffhomepage
path: root/expand.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-05-29 21:13:42 +1000
committerGravatar axel <axel@liljencrantz.se>2006-05-29 21:13:42 +1000
commitd46dade2847de8bf9e02f734528614ec92e9e757 (patch)
tree0e599544a8afbbdbb28b119560bf847890b78b98 /expand.c
parent79b466441b2e49da68d4fe697cd263dc7a6cfdb9 (diff)
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
Diffstat (limited to 'expand.c')
-rw-r--r--expand.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/expand.c b/expand.c
index b6dcff82..b1ce9916 100644
--- a/expand.c
+++ b/expand.c
@@ -130,32 +130,6 @@ static wchar_t *expand_var( wchar_t *in )
return env_get( in );
}
-void expand_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) );
- }
-}
-
-
/**
Test if the specified string does not contain character which can
not be used inside a quoted string.
@@ -188,7 +162,7 @@ wchar_t *expand_escape_variable( const wchar_t *in )
string_buffer_t buff;
al_init( &l );
- expand_variable_array( in, &l );
+ tokenize_variable_array( in, &l );
sb_init( &buff );
switch( al_get_count( &l) )
@@ -834,7 +808,7 @@ static int expand_variables( wchar_t *in, array_list_t *out, int last_idx )
if( is_ok )
{
- expand_variable_array( var_val, &var_item_list );
+ tokenize_variable_array( var_val, &var_item_list );
if( !all_vars )
{
int j;