From 049378e758a007b58f9f147254e94eed19514600 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Tue, 12 Jun 2012 23:15:24 +0200 Subject: Fix bug with 0-byte files on Darwin 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 --- fb.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fb.in b/fb.in index 04750d6..7ca5b6c 100644 --- a/fb.in +++ b/fb.in @@ -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 -- cgit v1.2.3-24-g4f1b