Skip to contentSkip to conversation

_require_command: fixed typo

PATCH Superseded Omer Zilberberg 3 participants 3 messages May 7, 2015 – May 18, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 _require_command: fixed typo

fixes 9435b92 common: _require_command needs to handle parameters

---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
index 6ea107e..cd0f3e6 100644
@@ -1299,7 +1299,7 @@ _require_command()
 	fi
 
 	_command=`echo "$1" | awk '{ print $1 }'`
-	if [ ! -x $command ]; then
+	if [ ! -x $_command ]; then
 		_notrun "$_name utility required, skipped this test"
 	fi
 }
Signature · 1 line
1.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Omer Zilberberg

fixes 9435b92 common: _require_command needs to handle parameters

Yep, thanks!

Quoted 18 lines
---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
index 6ea107e..cd0f3e6 100644
@@ -1299,7 +1299,7 @@ _require_command()
 	fi
 
 	_command=`echo "$1" | awk '{ print $1 }'`
-	if [ ! -x $command ]; then
+	if [ ! -x $_command ]; then
 		_notrun "$_name utility required, skipped this test"
 	fi
 }
#2 lore raw
In reply to Omer Zilberberg
Quoted 12 lines · Omer Zilberberg

fixes 9435b92 common: _require_command needs to handle parameters

---
 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +0 -0
index 6ea107e..cd0f3e6 100644

common/rc _require_command() · line 1302

Quoted 5 lines
common/rc +1 -1
@@ -1299,7 +1299,7 @@ _require_command()
 	fi
 
 	_command=`echo "$1" | awk '{ print $1 }'`
-	if [ ! -x $command ]; then
+	if [ ! -x $_command ]; then

Can you please send v2 with $_command quoted? I found that if $_command is empty -x still treats it as executable, but not empty quoted string.

# prints ok
if [ -x ]; then echo ok; fi
# prints nothing
if [ -x "" ]; then echo ok; fi

Thanks,
Eryu