From 60ce10ad84d7f74c44e3a7660fe9824c3fe9d112 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Tue, 5 Mar 2019 21:10:11 +0100 Subject: [PATCH] functions/eval: Return 0 for empty arguments Fixes #5692. --- share/functions/eval.fish | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/share/functions/eval.fish b/share/functions/eval.fish index fc5f5aef4..20910e944 100644 --- a/share/functions/eval.fish +++ b/share/functions/eval.fish @@ -17,6 +17,12 @@ function eval -S -d "Evaluate parameters as a command" end end + if not string length -q -- $argv + # If the argument is empty, eval should return 0 for compatibility with other shells. + # See #5692. + return 0 + end + # If we are in an interactive shell, eval should enable full # job control since it should behave like the real code was # executed. If we don't do this, commands that expect to be