Fix a bug in which the user's choice to Cancel was not recognized. This was

caused by the standard (and correct) behavior of the shell to discard the
return status of lvalue-operands in a pipe-chain.

The solution is to not pipe the file-acquisition directly into sort(1) but
instead store the output (allowing immediate testing of the return status)
and later sort it.
This commit is contained in:
Devin Teske 2013-06-02 23:20:46 +00:00
parent faf9d0ce1c
commit e4cb6ac115

View File

@ -70,13 +70,14 @@ f_index_initialize()
f_show_info "$msg_attempting_to_fetch_file_from_selected_media" \
"$__path"
eval "$__var_to_set"='$( f_device_get media "$__path" | sort )'
eval "$__var_to_set"='$( f_device_get media "$__path" )'
if [ $? -ne $SUCCESS ]; then
f_show_msg "$msg_unable_to_get_file_from_selected_media" \
"$__path"
f_device_shutdown media
return $FAILURE
fi
eval "$__var_to_set"='$( debug= f_getvar "$__var_to_set" | sort )'
f_show_info "$msg_located_index_now_reading_package_data_from_it"
if ! f_index_read "$__var_to_set"; then