]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
fix(dracut-lib.sh): initialize variables in getargs
authorBenjamin Drung <benjamin.drung@canonical.com>
Wed, 11 Jun 2025 17:56:56 +0000 (19:56 +0200)
committerNeal Gompa (ニール・ゴンパ) <ngompa13@gmail.com>
Fri, 13 Jun 2025 02:01:07 +0000 (22:01 -0400)
Initialize the variables in `getargs` to make the function work with
`set -u`.

modules.d/80base/dracut-lib.sh

index 05c361c62045ffa27dc738f7efdd5852eb2d0aef..39a1539043b459774aa21d41733291b5528d4ebf 100755 (executable)
@@ -274,9 +274,8 @@ getargs() {
     debug_off
     CMDLINE=$(getcmdline)
     export CMDLINE
-    local _val _i _gfound _deprecated
+    local _val _i _gfound="" _deprecated=""
     unset _val
-    unset _gfound
     _newoption="$1"
     for _i in "$@"; do
         if [ "$_i" = "-d" ]; then