From 9d75b962fc05922d3085a8b4834b452a7640e7a2 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 3 May 2023 11:30:18 +0200 Subject: [PATCH] modalias.prov: fix spurious exitcode of 1 on reaching EOF Signed-off-by: Denys Vlasenko --- modalias.prov | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) mode change 100644 => 100755 modalias.prov diff --git a/modalias.prov b/modalias.prov old mode 100644 new mode 100755 index 6408a6e..edce340 --- a/modalias.prov +++ b/modalias.prov @@ -42,7 +42,11 @@ print_modaliases() { combine_modaliases() { declare tag class variants="" pos="" n - read class + + # Due to set -e, we can exit with exitcode 1 on read EOF + # and this makes our caller think we failed. "|| return 0" prevents this: + read class || return 0 + while read tag; do for ((n=0; n<${#class}; n++)); do if [ "*" != "${class:n:1}" -a \