Fix a bug in convert_comments.go.
The following code was misconverted:
BIO *peer; /* NULL if buf == NULL.
* If peer != NULL, then peer->ptr is also a bio_bio_st,
* and its "peer" member points back to us.
* peer != NULL iff init != 0 in the BIO. */
Per the criteria in the comment, this comment is eligible, which is what
we want. Only continuation lines must be prefixed by spaces. But the
loop treated the first line as immediately ineligible. Moreover, in that
case, it dropped the line on the floor rather than echoing it. Fix this
by dropping that case.
Change-Id: Ic523fe1e6bc8dde37a9897e2a93e815c11feb95a
Reviewed-on: https://boringssl-review.googlesource.com/18746
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/util/convert_comments.go b/util/convert_comments.go
index 9e8d654..6d948c6 100644
--- a/util/convert_comments.go
+++ b/util/convert_comments.go
@@ -165,12 +165,10 @@
endIdx := indexFrom(line, "*/", idx)
if endIdx < 0 {
+ // The comment is, so far, eligible for conversion.
inComment = true
- if allSpaces(line[:idx]) {
- // The comment is, so far, eligible for conversion.
- column = idx
- comment = []string{line}
- }
+ column = idx
+ comment = []string{line}
break
}