]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/yacc: fix copying action code when line comment is disabled
authorShenghou Ma <minux@golang.org>
Mon, 14 Sep 2015 05:28:57 +0000 (01:28 -0400)
committerMinux Ma <minux@golang.org>
Sun, 4 Oct 2015 01:36:03 +0000 (01:36 +0000)
Fixes #12601.

Change-Id: I0be69ffe9ba19934aaef1651845c725708db77de
Reviewed-on: https://go-review.googlesource.com/14546
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/yacc/yacc.go

index 4f83f50e4606aafe939c5cec3aa8186236b2b7bd..32d2e5e8199569fb7455b710203f22d5fadbdcc3 100644 (file)
@@ -1284,8 +1284,9 @@ func dumpprod(curprod []int, max int) {
 func cpyact(curprod []int, max int) {
 
        if !lflag {
-               fmt.Fprintf(fcode, "\n\t\t//line %v:%v\n\t\t", infile, lineno)
+               fmt.Fprintf(fcode, "\n\t\t//line %v:%v", infile, lineno)
        }
+       fmt.Fprint(fcode, "\n\t\t")
 
        lno := lineno
        brac := 0