aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/bd.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh/shrc.d/bd.sh')
-rw-r--r--sh/shrc.d/bd.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/sh/shrc.d/bd.sh b/sh/shrc.d/bd.sh
index 5593ff4d..a5344ae7 100644
--- a/sh/shrc.d/bd.sh
+++ b/sh/shrc.d/bd.sh
@@ -54,9 +54,10 @@ bd() {
# Print the target
printf '%s\n' "$dirname"
+ )"
- # If the subshell failed, return from the function with the same exit value
- )" || return
+ # If the subshell printed nothing, return with failure
+ [ -n "$1" ] || return
# Try to change into the determined directory
command cd -- "$@"