We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1372282 + 7374c74 commit 88a6f16Copy full SHA for 88a6f16
auxiliary.go
@@ -461,15 +461,21 @@ func NewLibrary(l *State, functions []RegistryFunction) {
461
462
func skipComment(r *bufio.Reader) (bool, error) {
463
bom := "\xEF\xBB\xBF"
464
- if ba, err := r.Peek(len(bom)); err != nil {
+ if ba, err := r.Peek(len(bom)); err != nil && err != io.EOF {
465
return false, err
466
} else if string(ba) == bom {
467
_, _ = r.Read(ba)
468
}
469
if c, _, err := r.ReadRune(); err != nil {
470
+ if err == io.EOF {
471
+ err = nil
472
+ }
473
474
} else if c == '#' {
475
_, err = r.ReadBytes('\n')
476
477
478
479
return true, err
480
481
return false, r.UnreadRune()
0 commit comments