Skip to content

Commit 2d276ad

Browse files
committed
[fix] : Fixed array string
Fixed to fail locale and kernel parsing
1 parent 3c3ee1d commit 2d276ad

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tools/kernel.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ get() {
101101
local _kernel _count=0
102102
for _kernel in "${_kernel_name_list[@]}"; do
103103
_count=$(( _count + 1 ))
104-
[[ "${_kernel}" = "${1}" ]] && echo "${_count}"
104+
[[ "${_kernel}" = "${1}" ]] && echo "${_count}" && return 0
105105
done
106106
echo -n "failed"
107-
return 0
107+
return 1
108108
}
109109
_kernel_line="$(_get_kernel_line "${1}")"
110110

@@ -118,7 +118,7 @@ get() {
118118
fi
119119

120120
# カーネル設定ファイルから該当の行を抽出
121-
readarray -t _kernel_config_line < <(grep -h -v ^'#' "${_kernel_config_file}" | grep -v ^$ | head -n "${_kernel_line}" | tail -n 1)
121+
readarray -t _kernel_config_line < <(grep -h -v ^'#' "${_kernel_config_file}" | grep -v ^$ | head -n "${_kernel_line}" | tail -n 1 | sed -e 's/ */ /g' | tr " " "\n")
122122

123123
# 抽出された行に書かれた設定をそれぞれの変数に代入
124124
# ここで定義された変数のみがグローバル変数

tools/locale.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ get() {
106106
fi
107107

108108
# ロケール設定ファイルから該当の行を抽出
109-
readarray -t _locale_config_line < <(grep -h -v ^'#' "${_locale_config_file}" | grep -v ^$ | head -n "${_locale_line_number}" | tail -n 1)
109+
readarray -t _locale_config_line < <(grep -h -v ^'#' "${_locale_config_file}" | grep -v ^$ | head -n "${_locale_line_number}" | tail -n 1 | tail -n 1 | sed -e 's/ */ /g' | tr " " "\n")
110110

111111
# 抽出された行に書かれた設定をそれぞれの変数に代入
112112
# ここで定義された変数のみがグローバル変数

0 commit comments

Comments
 (0)