diff --git a/setup.sh b/setup.sh
index 8c6209fb317a018bc5c581265269a68628f9e035..96c1515ca01f779ddb65df080452c4acefc6fec0 100755
--- a/setup.sh
+++ b/setup.sh
@@ -1653,7 +1653,7 @@ function waInstall() {
 # Name: 'waEnsureOnPath'
 # Role: Ensures that $BIN_PATH is on $PATH.
 function waEnsureOnPath() {
-    if [[ ":$PATH:" == *":$BIN_PATH:"* ]]; then
+    if [[ !":$PATH:" =~ *":?$BIN_PATH:?"* ]]; then
         echo -e "${WARNING_TEXT}[WARNING]${CLEAR_TEXT} It seems like '${BIN_PATH}' is not on PATH."
         echo -e "${WARNING_TEXT}[WARNING]${CLEAR_TEXT} You can add it by running:"
         # shellcheck disable=SC2086