Commit 5641a091 authored by Russ Cox's avatar Russ Cox

lib9: fix windows build (don't use runesmprint)

TBR=golang-dev
CC=golang-dev
https://golang.org/cl/7575046
parent 6ee75663
......@@ -30,18 +30,16 @@ WinRune*
torune(char *p)
{
int i, n;
Rune *r1;
Rune rr;
WinRune *r;
r1 = runesmprint("%s", p);
n = 0;
while(r1[n] != '\0')
n++;
n++;
r = malloc(n*sizeof r[0]);
for(i=0; i<n; i++)
r[i] = r1[i];
free(r1);
n = utflen(p);
r = malloc((n+1)*sizeof r[0]);
for(i=0; i<n; i++) {
p += chartorune(&rr, p);
r[i] = rr;
}
r[n] = '\0';
return r;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment