discover/pb-discover: #include <locale.h> for musl libc
[petitboot] / discover / grub2 / env.c
index 3598927e0f295c5656e2fa93ee3192d32a18b92e..7eda0953fd4f5ce7d1cd6b6f20964a1f62f16bed 100644 (file)
@@ -257,6 +257,10 @@ int builtin_save_env(struct grub2_script *script,
 
                name = argv[i];
                value = script_env_get(script, name);
+               if (!value) {
+                       pb_log("Saved unset environment variable %s!\n", name);
+                       value = "";
+               }
 
                update_env(buf + siglen, len - siglen, name, value);
        }