aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-06-15 15:59:56 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-06-15 15:59:56 +0000
commit5e6f8739be1b3de38ed7ad1c7dc80bc1f4c4bf31 (patch)
tree1b28564d52de256eaa333cac8c7a6b30ab3cd601 /package/base-files/files/etc
parent74f84753e7b102d938c0b291769086633c01544d (diff)
downloadupstream-5e6f8739be1b3de38ed7ad1c7dc80bc1f4c4bf31.tar.gz
upstream-5e6f8739be1b3de38ed7ad1c7dc80bc1f4c4bf31.tar.bz2
upstream-5e6f8739be1b3de38ed7ad1c7dc80bc1f4c4bf31.zip
some shell variable handling fixes
SVN-Revision: 7638
Diffstat (limited to 'package/base-files/files/etc')
-rwxr-xr-xpackage/base-files/files/etc/functions.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh
index 7ba59afbbe..8d1117163d 100755
--- a/package/base-files/files/etc/functions.sh
+++ b/package/base-files/files/etc/functions.sh
@@ -55,7 +55,7 @@ config_rename() {
local oldvar
local newvar
- [ "$OLD" -a "$NEW" ] || return
+ [ -n "$OLD" -a -n "$NEW" ] || return
for oldvar in `set | grep ^CONFIG_${OLD}_ | \
sed -e 's/\(.*\)=.*$/\1/'` ; do
newvar="CONFIG_${NEW}_${oldvar##CONFIG_${OLD}_}"
@@ -139,7 +139,7 @@ config_foreach() {
[ -z "$CONFIG_SECTIONS" ] && return 0
for section in ${CONFIG_SECTIONS}; do
config_get cfgtype "$section" TYPE
- [ -n "$type" -a "$cfgtype" != "$type" ] && continue
+ [ -n "$type" -a "x$cfgtype" != "x$type" ] && continue
eval "$function \"\$section\""
done
}
@@ -186,7 +186,7 @@ strtok() { # <string> { <variable> [<separator>] ... }
shift 2
done
- if [ $# -gt 0 -a "$val" ]; then
+ if [ $# -gt 0 -a -n "$val" ]; then
export ${NO_EXPORT:+-n} "$1=$val"; count=$((count+1))
fi