diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-06-12 23:15:24 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-06-12 23:15:24 +0200 |
commit | 049378e758a007b58f9f147254e94eed19514600 (patch) | |
tree | 7e603ca66c0c8cbe4c16943f1a280229aa9b8399 /fb.in | |
parent | 382d9e6ba16391100f6d85a8cc824776a552ff4c (diff) |
Fix bug with 0-byte files on Darwinv1.0.4n0nsense/master
Seems like wc -c $file doesn't return "0 $file" on Darwin. wc -c <
$file is simpler because it doesn't need cut and works fine, so we just
use that.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'fb.in')
-rw-r--r-- | fb.in | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -69,7 +69,7 @@ request_helper() { if [ "$mode" = "u" ]; then basefilename=`basename -- "$file"` if [ "`$STAT -- "$file"`" -eq "0" ] || printf "%s" "$basefilename" | grep -F -q ","; then - if [ "`wc -c -- "$file" | cut -d\ -f1`" -eq "0" ]; then + if [ "`wc -c < "$file"`" -eq "0" ]; then printf "%s\n" "Error: skipping 0-byte file: \"$file\"" >&2 return 1 fi |