summaryrefslogtreecommitdiff
blob: 5ec5b6601770579a1b6ac65fa88e259e78f54898 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 11a5ecb89de1e61b016f3d7f358b09a4e611f1ad Mon Sep 17 00:00:00 2001
From: Kent Fredric <kentfredric@gmail.com>
Date: Tue, 17 Jan 2017 12:18:10 +1300
Subject: [PATCH] tests/test.pl: stat the right file

stat(@_) is effectively stat scalar @_

becasue "stat" has a signature of "$" which coerces arrays to
scalars, which here, returns the length of the array.

This is going to be number 1, instead of the desired argument,
     the filename.
---
 tests/test.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test.pl b/tests/test.pl
index 658eadf..5513d6e 100755
--- a/tests/test.pl
+++ b/tests/test.pl
@@ -185,7 +185,7 @@ sub input_filepath {
 }
 
 sub filesize {
-  return (stat(@_))[7];
+  return (stat($_[0]))[7];
 }
 
 sub md5_file {
-- 
2.11.0