aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2013-08-06 18:44:22 +0200
committerUlrich Müller <ulm@gentoo.org>2013-08-06 18:44:22 +0200
commitcc328120d3e55456e68a8823caaf02c8a43e742f (patch)
treeed5cdcab6360b7725ec6207775c815e8700f0cd7 /libs
parentRemove stale man page for bashcomp module. (diff)
downloadeselect-cc328120d3e55456e68a8823caaf02c8a43e742f.tar.gz
eselect-cc328120d3e55456e68a8823caaf02c8a43e742f.tar.bz2
eselect-cc328120d3e55456e68a8823caaf02c8a43e742f.zip
Declare IFS as local variable.
* libs/config.bash.in (store_config): * libs/default.eselect.in (show_usage_message): * libs/editor-variable.bash.in (do_set): * libs/output.bash.in (write_kv_list_entry): * modules/env.eselect (create_profile_env, create_prelink_conf): * modules/news.eselect (do_list, do_read): Declare IFS as local variable.
Diffstat (limited to 'libs')
-rw-r--r--libs/config.bash.in3
-rw-r--r--libs/default.eselect.in6
-rw-r--r--libs/editor-variable.bash.in4
-rw-r--r--libs/output.bash.in6
4 files changed, 8 insertions, 11 deletions
diff --git a/libs/config.bash.in b/libs/config.bash.in
index 9b8cdd8..e5e0089 100644
--- a/libs/config.bash.in
+++ b/libs/config.bash.in
@@ -55,8 +55,7 @@ store_config() {
(
# parse the names of all settings in the file
- local ifs_save=${IFS-$' \t\n'}
- IFS=$'\n'
+ local ifs_save=${IFS} IFS=$'\n'
for line in ${content} ; do
[[ ${line/=/} != ${line} ]] || continue
line=${line/=*/}
diff --git a/libs/default.eselect.in b/libs/default.eselect.in
index e214596..5783a8d 100644
--- a/libs/default.eselect.in
+++ b/libs/default.eselect.in
@@ -53,7 +53,7 @@ show_usage_message() {
continue
;;
?*)
- local desc="" ifs_save="${IFS}" action_text line options
+ local desc="" action_text line options
is_function "describe_${action}" && desc=$(describe_${action})
if is_function "describe_${action}_parameters"; then
@@ -66,13 +66,13 @@ show_usage_message() {
if is_function "describe_${action}_options"; then
options=$(describe_${action}_options)
- IFS=$'\n'
+ local ifs_save=${IFS} IFS=$'\n'
for line in ${options}; do
write_kv_list_entry -p \
" ${line%%*( ):*}" \
" ${line##+([^:]):*( )}"
done
- IFS="${ifs_save}"
+ IFS=${ifs_save}
fi
;;
esac
diff --git a/libs/editor-variable.bash.in b/libs/editor-variable.bash.in
index 4de9736..e377832 100644
--- a/libs/editor-variable.bash.in
+++ b/libs/editor-variable.bash.in
@@ -119,7 +119,7 @@ do_set() {
[[ -z $1 ]] && die -q "You didn't tell me what to set the variable to"
[[ $# -gt 1 ]] && die -q "Too many parameters"
- local target=$1 targets=() dir ifs_save=${IFS-$' \t\n'}
+ local target=$1 targets=() dir
# target may be specified by its name or its index
if is_number "${target}"; then
@@ -132,7 +132,7 @@ do_set() {
if [[ ${EDITOR_LIST} != *:* ]]; then
# is the target an absolute path? if not, try to find it
if [[ ${target} != /* ]]; then
- IFS=:
+ local ifs_save=${IFS} IFS=:
for dir in ${EDITOR_PATH-/bin:/usr/bin}; do
[[ -f ${EROOT}${dir}/${target} ]] || continue
target=${EPREFIX}${dir}/${target}
diff --git a/libs/output.bash.in b/libs/output.bash.in
index fd08844..bf29721 100644
--- a/libs/output.bash.in
+++ b/libs/output.bash.in
@@ -88,11 +88,10 @@ write_list_start() {
# Args may include text highlighting. If -p is passed, use 'plain'
# highlighting rather than bold.
write_kv_list_entry() {
- local n text key val lindent rindent ifs_save=${IFS}
+ local n text key val lindent rindent
local left=${COLOUR_LIST_LEFT} right=${COLOUR_LIST_RIGHT}
local normal=${COLOUR_NORMAL}
-
- IFS=$' \t\n'
+ local IFS=$' \t\n'
if [[ ${1} == "-p" ]] ; then
left=; right=; normal=
@@ -150,7 +149,6 @@ write_kv_list_entry() {
echo -n -e "${cwords}"
fi
echo -e "${normal}"
- IFS=${ifs_save}
}
# write_numbered_list_entry PUBLIC