bugfix: copy the correct variable
License: MIT Signed-off-by: Zach Ramsay <zach.ramsay@gmail.com>
zramsay committed
Jun 2, 2017 at 23:50 UTC
6c064d1fc3cdf5ea25908f6b03b833dc9a978ac1
1 file changed
+6
-1
core/commands/files/files.go
+6
-1
@@ -664,7 +664,12 @@ stat' on the file or any of its ancestors.
664
return
665
}
666
667
- n, err := io.Copy(wfd, input)
667
+ var r io.Reader = input
668
+ if countfound {
669
+ r = io.LimitReader(r, int64(count))
670
+ }
671
+
672
+ n, err := io.Copy(wfd, r)
673
if err != nil {
674
res.SetError(err, cmds.ErrNormal)
675
return