add support to nil-byte separated input strings, closes #121

This commit is contained in:
Giulio Iotti
2015-06-08 06:36:21 +00:00
parent 443a80f254
commit f6dd32046e
3 changed files with 22 additions and 23 deletions

View File

@@ -113,7 +113,7 @@ func Run(opts *Options) {
// Reader
streamingFilter := opts.Filter != nil && !sort && !opts.Tac && !opts.Sync
if !streamingFilter {
reader := Reader{func(str string) { chunkList.Push(str) }, eventBox}
reader := Reader{func(str string) { chunkList.Push(str) }, eventBox, opts.ReadZero}
go reader.ReadSource()
}
@@ -139,7 +139,7 @@ func Run(opts *Options) {
if pattern.MatchItem(item) {
fmt.Println(*item.text)
}
}, eventBox}
}, eventBox, opts.ReadZero}
reader.ReadSource()
} else {
eventBox.Unwatch(EvtReadNew)