From 093a86d9c09295e79a7e8f271c9f05dd91a85e4b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 29 Apr 2025 12:01:13 +0100 Subject: init.sh: don't use eval to read version files it's not necessary, and was the cause of a recent issue, which i mitigated, but why mitigate it? prevent bugs. don't use eval unless absolutely necessary. Signed-off-by: Leah Rowe --- include/init.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/init.sh') diff --git a/include/init.sh b/include/init.sh index b515cebc..09b3223b 100644 --- a/include/init.sh +++ b/include/init.sh @@ -161,9 +161,8 @@ xbmk_set_env() xbmk_set_version() { - for fv in version versiondate; do - eval "[ ! -f \"\.$fv\" ] || read -r $fv < \"\.$fv\" || :" - done + [ ! -f ".version" ] || read -r version < ".version" || :; : + [ ! -f ".versiondate" ] || read -r versiondate < ".versiondate" || :; : [ -e ".git" ] || [ -f ".version" ] || printf "unknown\n" > ".version" \ || $err "Cannot generate unknown .version file" -- cgit v1.2.1