summaryrefslogtreecommitdiff
path: root/sys/src/cmd/db/command.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-03-19 11:44:26 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2015-03-19 11:44:26 +0100
commitc86561f6257fd865590caacb3a4ad709c848eb68 (patch)
treec62b6aa5904ab0b3598edc82306187fffcec3122 /sys/src/cmd/db/command.c
parent4d0343c9d2db502c162f5050385ba5528aef2a47 (diff)
db: fix unicode support (thanks giacomo)
from the unicode-db patch readme: command() receives a char* that is assigned to lp, which is a Rune*, and lp is incremented later in readchar(), so each read consumed 4 bytes. The only time command() is called is in runpcs() with bkpt->comm, which is a char* built in subpcs through a char*, so the string stored in bkpt->comm was not a Rune string. A way to test the bug is: db program main:b argv/X :r
Diffstat (limited to 'sys/src/cmd/db/command.c')
-rw-r--r--sys/src/cmd/db/command.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/cmd/db/command.c b/sys/src/cmd/db/command.c
index c45f306df..d855b7546 100644
--- a/sys/src/cmd/db/command.c
+++ b/sys/src/cmd/db/command.c
@@ -23,8 +23,8 @@ WORD adrval, cntval, loopcnt;
int adrflg, cntflg;
/* command decoding */
-
-command(char *buf, int defcom)
+int
+command(Rune *buf, int defcom)
{
char *reg;
char savc;
@@ -39,7 +39,7 @@ command(char *buf, int defcom)
if (*buf==EOR)
return(FALSE);
clrinp();
- lp=(Rune*)buf;
+ lp=buf;
}
do {
adrflg=expr(0); /* first address */