Fix script/inline-c-relative-includes.go.

This commit is contained in:
Nigel Tao committed 2017-11-03 15:33:23 +11:00
1 parent aec5715f12
commit e3643574d7
1 file changed
+3 -3
+3 -3
View File
@@ -80,9 +80,9 @@ func do(w *bufio.Writer, dir string, filename string, depth int) error {
r := bufio.NewScanner(f)
for r.Scan() {
s := r.Bytes()
line := r.Bytes()
if bytes.HasPrefix(s, prefix) {
if s := line; bytes.HasPrefix(s, prefix) {
s = s[len(prefix):]
if bytes.HasSuffix(s, suffix) {
s = s[:len(s)-len(suffix)]
@@ -98,7 +98,7 @@ func do(w *bufio.Writer, dir string, filename string, depth int) error {
}
}
w.Write(s)
w.Write(line)
w.WriteByte('\n')
}
return r.Err()