From a18208fb608bd28d29b868b0f88b33f755529bf0 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 3 Sep 2009 13:56:06 -0700 Subject: [PATCH] fix range on invalid utf8 bug R=r DELTA=42 (21 added, 20 deleted, 1 changed) OCL=34328 CL=34333 --- src/pkg/runtime/rune.c | 3 ++- test/{bugs => fixedbugs}/bug204.go | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename test/{bugs => fixedbugs}/bug204.go (100%) diff --git a/src/pkg/runtime/rune.c b/src/pkg/runtime/rune.c index 652ccdfa66..598edc6f36 100644 --- a/src/pkg/runtime/rune.c +++ b/src/pkg/runtime/rune.c @@ -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; } diff --git a/test/bugs/bug204.go b/test/fixedbugs/bug204.go similarity index 100% rename from test/bugs/bug204.go rename to test/fixedbugs/bug204.go