]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
dracut-functions.sh: set IFS only for variable setting
authorHarald Hoyer <harald@redhat.com>
Wed, 22 Feb 2012 12:04:37 +0000 (13:04 +0100)
committerHarald Hoyer <harald@redhat.com>
Wed, 22 Feb 2012 15:13:20 +0000 (16:13 +0100)
dracut-functions.sh

index 653f401b52b5408de0d2425db8949409c2c2f0ae..3dfb11614464adb115c9ecc482b69c7489b74229 100755 (executable)
@@ -111,7 +111,7 @@ normalize_path() {
 # ../../bin/test-2
 # $ ln -s $(convert_abs_rel /usr/bin/test /bin/test-2) /usr/bin/test
 convert_abs_rel() {
-    local __current __absolute __abssize __cursize __newpath __oldifs
+    local __current __absolute __abssize __cursize __newpath
     local -i __i __level
 
     set -- "$(normalize_path "$1")" "$(normalize_path "$2")"
@@ -122,11 +122,8 @@ convert_abs_rel() {
     # corner case #2 - own dir link
     [[ "${1%/*}" == "$2" ]] && { echo "."; return; }
 
-    __oldifs="$IFS"
-    IFS="/"
-    __current=($1)
-    __absolute=($2)
-    IFS="$__oldifs"
+    IFS="/" __current=($1)
+    IFS="/" __absolute=($2)
 
     __abssize=${#__absolute[@]}
     __cursize=${#__current[@]}