Skip to content

Commit

Permalink
Fix rune count in X, x event messages (#490)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Lalonde <[email protected]>
Co-authored-by: Robert Kroeger <[email protected]>
  • Loading branch information
3 people authored May 4, 2023
1 parent 73ec48e commit b54e04d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"strconv"
"strings"
"time"
"unicode/utf8"

"9fans.net/go/plan9"
"9fans.net/go/plan9/client"
Expand Down Expand Up @@ -223,9 +224,9 @@ func execute(t *Text, aq0 int, aq1 int, external bool, argt *Text) {
}
}
if a != "" {
t.w.Eventf("%c0 0 0 %d %v\n", c, len(a), a)
t.w.Eventf("%c0 0 0 %d %v\n", c, utf8.RuneCountInString(a), a)
if aa != "" {
t.w.Eventf("%c0 0 0 %d %v\n", c, len(aa), aa)
t.w.Eventf("%c0 0 0 %d %v\n", c, utf8.RuneCountInString(aa), aa)
} else {
t.w.Eventf("%c0 0 0 0 \n", c)
}
Expand Down

0 comments on commit b54e04d

Please sign in to comment.