Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/xurls: don't use bufio.Scanner to scan the input
It was a convenient way to obtain the input in chunks, so that the tool could print urls incrementally without having to read the entirety of the input at once. Unfortunately, we failed to notie that bufio.Scanner has a hard limit on the size of each "token". In our particular case, it meant that any sequence of many thousands of input bytes without any whitespace could make the tool error out. Instead, use bufio.Reader, which grows a buffer to fit the data being read. Go back to reading one line at a time, as it can only stop at one specific byte like '\n', and not many of them like all whitespace characters. Fixes #28.
- Loading branch information