Validate that the file exists rather than obscure 'Not an elf file' error.
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
b69c69e000
commit
d1db5f8fef
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=294355
@ -29,6 +29,11 @@ while getopts "Uv" flag; do
|
|||||||
done
|
done
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
|
if ! [ -f "$1" ]; then
|
||||||
|
echo "No such file or directory: $1" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
mime=$(file -L --mime-type $1)
|
mime=$(file -L --mime-type $1)
|
||||||
isbin=0
|
isbin=0
|
||||||
case $mime in
|
case $mime in
|
||||||
|
Loading…
Reference in New Issue
Block a user