-
Notifications
You must be signed in to change notification settings - Fork 50
Closed
Labels
Description
enry.GetLanguage changes the contents of its second argument - the byte slice. How to reproduce:
reproduce.go
package main
import (
"io/ioutil"
"os"
"gopkg.in/src-d/enry.v1"
)
func main() {
data, _ := ioutil.ReadAll(os.Stdin)
language := enry.GetLanguage("ParabolicPointer.cs", data)
os.Stdout.Write(data)
println(language)
}cat ParabolicPointer.cs | go run reproduce.go > new.cs
diff ParabolicPointer.cs new.cs
You should see
50c50
< for(int i=0; i<points; i++)
---
> for(int i=0; i<points;>i++)
ParabolicPointer.cs: ParabolicPointer.zip
This is the root cause of src-d/hercules#178