mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-22 22:23:32 +00:00
btrfs-progs: tests: fix _is_file_or_command detection
type -p returns an empty string for nonexistent commands, but the -f test on an empty string does not behave the same on all shells. To be safe, use the quoted value. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ffb2878e1e
commit
fb0d53a937
@ -35,7 +35,8 @@ _is_file_or_command()
|
|||||||
if [ -f "$msg" -o -d "$msg" -o -b "$msg" ]; then
|
if [ -f "$msg" -o -d "$msg" -o -b "$msg" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
if [ -f $(type -p "$msg") ]; then
|
msg=$(type -p "$msg")
|
||||||
|
if [ -f "$msg" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
|
Loading…
Reference in New Issue
Block a user