flac2ogg: use the correct variable in loops

While there, adjust the error message to be more aligned to the rest of
the scripts.
This commit is contained in:
Lucas 2020-05-03 13:53:48 +00:00
parent 17ef04b41a
commit afb13d9c9c

View File

@ -1,6 +1,6 @@
#!/bin/sh
# flac2ogg
# Written in 2019 by Lucas
# Written in 2019-2020 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
@ -36,7 +36,7 @@ rc=0
if [ -t 0 ]; then
if [ $# -gt 0 ]; then
for flac in "$@"; do
[ -f "$1" ] || err "Missing file \"$1\"."
[ -f "$flac" ] || err "$flac: not found"
convert_to_ogg "$flac" || rc=$?
done
else
@ -47,7 +47,7 @@ if [ -t 0 ]; then
fi
else
while read -r flac; do
[ -f "$1" ] || err "Missing file \"$1\"."
[ -f "$flac" ] || err "$flac: not found"
convert_to_ogg "$flac" || rc=$?
done
fi