diff options
author | dteske <dteske@FreeBSD.org> | 2013-07-05 19:57:40 +0000 |
---|---|---|
committer | dteske <dteske@FreeBSD.org> | 2013-07-05 19:57:40 +0000 |
commit | dae6ea95bebbdb46d17ef97e559cf84dcf37235d (patch) | |
tree | 201072af02fb15fc6d8a3a641724f44a0acf9147 /usr.sbin/bsdconfig | |
parent | f00a060f04f6e177a5ee03ef9d1b1951505096cf (diff) | |
download | FreeBSD-src-dae6ea95bebbdb46d17ef97e559cf84dcf37235d.zip FreeBSD-src-dae6ea95bebbdb46d17ef97e559cf84dcf37235d.tar.gz |
Don't calculate the tag until we know that we're going to make a new menu
item entry. Also join simple NULL assignments into a single line.
Diffstat (limited to 'usr.sbin/bsdconfig')
-rwxr-xr-x | usr.sbin/bsdconfig/bsdconfig | 9 | ||||
-rw-r--r-- | usr.sbin/bsdconfig/share/common.subr | 16 |
2 files changed, 17 insertions, 8 deletions
diff --git a/usr.sbin/bsdconfig/bsdconfig b/usr.sbin/bsdconfig/bsdconfig index e290c76..b637961 100755 --- a/usr.sbin/bsdconfig/bsdconfig +++ b/usr.sbin/bsdconfig/bsdconfig @@ -170,11 +170,8 @@ dialog_menu_main() local menuitem menu_title menu_help menu_selection index=2 for menuitem in $( cd $BSDCFG_LIBE && ls -d [0-9][0-9][0-9].* ); do [ $index -lt ${#DIALOG_MENU_TAGS} ] || break - tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 ) - menu_program= - menu_title= - menu_help= + menu_program= menu_title= menu_help= f_include_lang $BSDCFG_LIBE/$menuitem/INDEX [ "$menu_program" ] || continue @@ -183,9 +180,11 @@ dialog_menu_main() *) menu_program="$menuitem/$menu_program" esac + tag=$( f_substr "$DIALOG_MENU_TAGS" $index 1 ) + setvar "menu_program$tag" "$menu_program" + f_shell_escape "$menu_title" menu_title f_shell_escape "$menu_help" menu_help - setvar "menu_program$tag" "$menu_program" menu_list="$menu_list '$tag' '$menu_title' '$menu_help'" index=$(( $index + 1 )) diff --git a/usr.sbin/bsdconfig/share/common.subr b/usr.sbin/bsdconfig/share/common.subr index 32d6aba..6c0400a 100644 --- a/usr.sbin/bsdconfig/share/common.subr +++ b/usr.sbin/bsdconfig/share/common.subr @@ -531,12 +531,22 @@ f_index_file() if [ "$lang" ]; then awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && - return + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX.$lang && return # No match, fall-thru to non-i18n sources fi awk -v keyword="$keyword" "$f_index_file_awk" \ - $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX + $BSDCFG_LIBE${BSDCFG_LIBE:+/}*/INDEX && return + + # No match? Fall-thru to `local' libexec sources (add-on modules) + + [ "$BSDCFG_LOCAL_LIBE" ] || return $FAILURE + if [ "$lang" ]; then + awk -v keyword="$keyword" "$f_index_file_awk" \ + $BSDCFG_LOCAL_LIBE/*/INDEX.$lang && return + # No match, fall-thru to non-i18n sources + fi + awk -v keyword="$keyword" "$f_index_file_awk" \ + $BSDCFG_LOCAL_LIBE/*/INDEX } # f_index_menusel_keyword $indexfile $pgm |