Fix broken sort on printing of variable names in set builtin

darcs-hash:20050920224640-ac50b-cfa316f9a6168e582d3a6057bdda414ce5b56851.gz
This commit is contained in:
axel 2005-09-21 08:46:40 +10:00
parent 8173c736cc
commit 3a60fc5206

View file

@ -229,15 +229,12 @@ static void print_variables(int include_values, int escape, int scope)
al_init( &names );
env_get_names( &names, scope );
names_arr = list_to_char_arr( &names );
qsort( names_arr,
al_get_count( &names ),
sizeof(wchar_t *),
(int (*)(const void *, const void *))&wcsfilecmp );
sort_list( &names );
for( i = 0; i < al_get_count(&names); i++ )
{
wchar_t *key = names_arr[i];
wchar_t *key = al_get( &names, i );
/* Why does expand_escape free its argument ?! */
wchar_t *e_key = escape ? expand_escape(wcsdup(key), 1) : wcsdup(key);
sb_append(sb_out, e_key);
@ -253,9 +250,7 @@ static void print_variables(int include_values, int escape, int scope)
sb_append(sb_out, L"\n");
free(e_key);
}
free(names_arr);
al_destroy(&names);
al_destroy(&names);
}
/**