From c1c7a7da454dd7d0f45b1cb767bc1f07459ff54d Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Wed, 3 Dec 2008 23:17:41 +0100 Subject: few fixes --- src/core/libs/lib-ui-interactive.sh | 8 ++++---- src/core/libs/lib-ui.sh | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 0fcef00..c399b08 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -398,7 +398,7 @@ interactive_filesystems() { do # generate a menu based on the information in the datafile menu_list= - while read $part $type $label $fs + while read part type label fs do menu_list="$menu_list $part (type:$type,label:$label,fs:$fs)" #don't add extra spaces, dialog doesn't like that. done < $BLOCK_DATA @@ -408,9 +408,9 @@ interactive_filesystems() { [ "$ANSWER_OPTION" == DONE ] && USERHAPPY=1 && break part=$ANSWER_OPTION - part_type=` awk "/^$part/ {print \$2}" $BLOCK_DATA` - part_label=`awk "/^$part/ {print \$3}" $BLOCK_DATA` - fs=` awk "/^$part/ {print \$4}" $BLOCK_DATA` + part_type=` awk "/^${part//\//\\\/}/ {print \$2}" $BLOCK_DATA` # the bash substition replaces all /'s with \/'s otherwise awk complains + part_label=`awk "/^${part//\//\\\/}/ {print \$3}" $BLOCK_DATA` + fs=` awk "/^${part//\//\\\/}/ {print \$4}" $BLOCK_DATA` [ "$part_label" == no_label ] && part_label= [ "$fs" == no_fs ] && fs= diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 61fface..d4520bc 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -224,6 +224,7 @@ _dia_ask_option () _cli_ask_option () { #TODO: strip out color codes + #TODO: if user entered incorrect choice, ask him again DEFAULT="" [ "$1" != 'no' ] && DEFAULT=$1 [ -z "$2" ] && die_error "ask_option \$2 must be the title" -- cgit v1.2.3-54-g00ecf