From 46862b797fa6c27c66222e9acc05f5509f3b7d39 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Sun, 20 Aug 2017 12:41:08 +0200 Subject: [PATCH] Fix command line parsing with expr(1) failing if the parameter is 0. --- build-aux/iso-grub-cfg.sh | 2 +- update-initrd/update-initrd | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build-aux/iso-grub-cfg.sh b/build-aux/iso-grub-cfg.sh index 1f34d235..bb66a5f0 100755 --- a/build-aux/iso-grub-cfg.sh +++ b/build-aux/iso-grub-cfg.sh @@ -17,7 +17,7 @@ for argument do fi case $argument in - *=?*) parameter=$(expr "X$argument" : '[^=]*=\(.*\)') ;; + *=?*) parameter=$(expr "X$argument" : '[^=]*=\(.*\)' || true) ;; *=) parameter= ;; *) parameter=yes ;; esac diff --git a/update-initrd/update-initrd b/update-initrd/update-initrd index 2e516e3e..2d4cfddb 100755 --- a/update-initrd/update-initrd +++ b/update-initrd/update-initrd @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2015, 2016 Jonas 'Sortie' Termansen. +# Copyright (c) 2015, 2016, 2017 Jonas 'Sortie' Termansen. # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -29,7 +29,7 @@ for argument do continue fi case $argument in - *=?*) parameter=$(expr "X$argument" : '[^=]*=\(.*\)') ;; + *=?*) parameter=$(expr "X$argument" : '[^=]*=\(.*\)' || true) ;; *=) parameter= ;; *) parameter=yes ;; esac