aboutsummaryrefslogtreecommitdiff
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 /modules
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 'modules')
-rw-r--r--modules/env.eselect13
-rw-r--r--modules/news.eselect11
2 files changed, 10 insertions, 14 deletions
diff --git a/modules/env.eselect b/modules/env.eselect
index bdc396d..6c77005 100644
--- a/modules/env.eselect
+++ b/modules/env.eselect
@@ -82,7 +82,7 @@ update_envvar_classes() {
# Create profile.env file
create_profile_env() {
local -a envfiles
- local vars store items tmpprofile ifs_save
+ local vars store items tmpprofile ifs_save=${IFS}
envfiles=( "${EROOT}"/etc/env.d/* )
# Blank the file first!
@@ -116,8 +116,7 @@ create_profile_env() {
store=$(load_config "${envfile}" ${var})
else
items=$(load_config "${envfile}" ${var})
- ifs_save=${IFS-$' \t\n'}
- IFS=":"
+ local IFS=:
for item in ${items}; do
has ${item} ${store} \
|| store="${store}${store:+:}${item}"
@@ -146,8 +145,7 @@ create_profile_env() {
has LDPATH ${vars} || continue
# Store LDPATH for later processing
items=$(load_config "${envfile}" LDPATH)
- ifs_save=${IFS-$' \t\n'}
- IFS=":"
+ local IFS=:
items=( ${items} )
IFS=${ifs_save}
for item in "${items[@]}"; do
@@ -183,7 +181,7 @@ create_ld_so_conf() {
create_prelink_conf() {
[[ -z ${ESELECT_LDPATH[@]} ]] \
&& die -q "No LDPATHs found in ${EROOT}/etc/env.d/*"
- local path prelink_path prelink_mask str x ifs_save
+ local path prelink_path prelink_mask str x
str="# prelink.conf autogenerated by eselect\n"
str="${str}# Make all changes to /etc/env.d files\n"
# Add default items
@@ -197,8 +195,7 @@ create_prelink_conf() {
path=$(load_config "${ENVPROFILE}" PATH)
prelink_path=$(load_config "${ENVPROFILE}" PRELINK_PATH)
prelink_mask=$(load_config "${ENVPROFILE}" PRELINK_PATH_MASK)
- ifs_save=${IFS-$' \t\n'}
- IFS=":"
+ local ifs_save=${IFS} IFS=:
for x in ${path} ${prelink_path} "${ESELECT_LDPATH[@]}"; do
has ${x} ${prelink_mask} && continue
[[ -z ${x##*/} ]] || x="${x}/"
diff --git a/modules/news.eselect b/modules/news.eselect
index dd6b3bd..c48b9c1 100644
--- a/modules/news.eselect
+++ b/modules/news.eselect
@@ -164,8 +164,7 @@ describe_list() {
do_list() {
local item stat repo dir header line title posted i=1
- local cols=${COLUMNS:-80}
- local ifs_save=${IFS-$' \t\n'}
+ local cols=${COLUMNS:-80} ifs_save=${IFS}
local -a repos dirs
set -- $(find_items unread read)
@@ -179,7 +178,7 @@ do_list() {
[[ ${posted} == +([0-9])-+([0-9])-+([0-9]) ]] || posted="(no date) "
header=$(read_item "${dir}" "${item}" header) \
|| title="(${item} - removed?)"
- IFS=$'\n'
+ local IFS=$'\n'
for line in ${header}; do
case "${line%%:*}" in
Title) title=${line##*([^:]):*([[:space:]])} ;;
@@ -242,7 +241,7 @@ describe_read_parameters() {
do_read() {
local -a items=( $(find_items unread read) ) repos dirs
- local n=${#items[@]} format=cooked ifs_save=${IFS-$' \t\n'}
+ local n=${#items[@]} format=cooked ifs_save=${IFS}
local item repo stat dir header line i seq repos_upd author title posted
while [[ $# -gt 0 ]]; do
@@ -283,7 +282,7 @@ do_read() {
cooked)
write_list_start "${item}"
header=$(read_item "${dir}" "${item}" header)
- IFS=$'\n'
+ local IFS=$'\n'
for line in ${header}; do
case "${line%%:*}" in
Title)
@@ -303,7 +302,7 @@ do_read() {
mbox)
if header=$(read_item "${dir}" "${item}" header); then
author=""; title=""; posted=""
- IFS=$'\n'
+ local IFS=$'\n'
for line in ${header}; do
case "${line%%:*}" in
Author) : ${author:=${line##*([^:]):*([[:space:]])}} ;;