]> Cypherpunks repositories - gostls13.git/commitdiff
fix range on invalid utf8 bug
authorRuss Cox <rsc@golang.org>
Thu, 3 Sep 2009 20:56:06 +0000 (13:56 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 3 Sep 2009 20:56:06 +0000 (13:56 -0700)
R=r
DELTA=42  (21 added, 20 deleted, 1 changed)
OCL=34328
CL=34333

src/pkg/runtime/rune.c
test/fixedbugs/bug204.go [moved from test/bugs/bug204.go with 100% similarity]

index 652ccdfa666e75b309d49d4e50307ccb5beeb7d9..598edc6f3699fca190f8b87e6011255ef972a288 100644 (file)
@@ -161,8 +161,9 @@ bad:
        *rune = Bad;
        return 1;
 badlen:
+       // was return 0, but return 1 is more convenient for the runtime.
        *rune = Bad;
-       return 0;
+       return 1;
 
 }
 
similarity index 100%
rename from test/bugs/bug204.go
rename to test/fixedbugs/bug204.go