summaryrefslogtreecommitdiffstats
path: root/fb.in
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-06-12 23:15:24 +0200
committerFlorian Pritz <bluewind@xinu.at>2012-06-12 23:15:24 +0200
commit049378e758a007b58f9f147254e94eed19514600 (patch)
tree7e603ca66c0c8cbe4c16943f1a280229aa9b8399 /fb.in
parent382d9e6ba16391100f6d85a8cc824776a552ff4c (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.in2
1 files changed, 1 insertions, 1 deletions
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