]> git.ipfire.org Git - thirdparty/dehydrated.git/commitdiff
fix zsh compatibility (fixes #896)
authorLukas Schauer <lukas@schauer.dev>
Mon, 16 Jan 2023 21:41:05 +0000 (22:41 +0100)
committerLukas Schauer <lukas@schauer.dev>
Mon, 16 Jan 2023 21:41:05 +0000 (22:41 +0100)
dehydrated

index c11d7d0fcabea146949a85e061e942d973c56c0d..a2bff40846c8938fb3ef70b9f9e6871d69ec2a76 100755 (executable)
@@ -143,7 +143,7 @@ jsonsh() {
 
     # Force zsh to expand $A into multiple words
     local is_wordsplit_disabled
-    is_wordsplit_disabled="$(unsetopt 2>/dev/null | grep -c '^shwordsplit$')"
+    is_wordsplit_disabled="$(unsetopt 2>/dev/null | grep -c '^shwordsplit$' || true)"
     if [ "${is_wordsplit_disabled}" != "0" ]; then setopt shwordsplit; fi
     $GREP "$STRING|$NUMBER|$KEYWORD|$SPACE|." | grep -Ev "^$SPACE$"
     if [ "${is_wordsplit_disabled}" != "0" ]; then unsetopt shwordsplit; fi