Skip to content

Commit

Permalink
do not skip big files when -f is used
Browse files Browse the repository at this point in the history
  • Loading branch information
piranha committed Jul 1, 2013
1 parent 515e88c commit ba2b998
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ supported as replacement, no regexp submatch support yet (planned, though).

## Changelog

- 1.4
- Fix skipping big files when searching only in file names
- 1.3
- Fix stack trace dump on Linux when file is not readable
- 1.2
Expand Down
10 changes: 5 additions & 5 deletions goreplace.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

var (
Author = "Alexander Solovyov"
Version = "1.3"
Version = "1.4"

byteNewLine = []byte("\n")
)
Expand Down Expand Up @@ -174,13 +174,13 @@ func (v *GRVisitor) VisitFile(fn string, fi os.FileInfo) {
return
}

if fi.Size() >= 1024*1024*10 {
fmt.Fprintf(os.Stderr, "Skipping %s, too big: %d\n", fn, fi.Size())
if opts.FindFiles {
v.SearchFileName(fn)
return
}

if opts.FindFiles {
v.SearchFileName(fn)
if fi.Size() >= 1024*1024*10 {
fmt.Fprintf(os.Stderr, "Skipping %s, too big: %d\n", fn, fi.Size())
return
}

Expand Down

0 comments on commit ba2b998

Please sign in to comment.