diff options
author | Sigrid <ftrvxmtrx@gmail.com> | 2020-12-28 12:24:47 +0100 |
---|---|---|
committer | Sigrid <ftrvxmtrx@gmail.com> | 2020-12-28 12:24:47 +0100 |
commit | 67672ffdc9a537ef852c0edd89a5d8cef7346d11 (patch) | |
tree | c3b3ca63192d811597f9a970eacc05286ff1b3cf | |
parent | 0596178dd660daaeedeb7eaaea5c0cf27fb49d41 (diff) | |
download | plan9front-67672ffdc9a537ef852c0edd89a5d8cef7346d11.tar.xz |
plumb: fix wrong click attribute offset (thanks umbraticus)
-rw-r--r-- | sys/src/cmd/plumb/match.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/src/cmd/plumb/match.c b/sys/src/cmd/plumb/match.c index b6b4f6d65..22fb36b16 100644 --- a/sys/src/cmd/plumb/match.c +++ b/sys/src/cmd/plumb/match.c @@ -48,13 +48,12 @@ int clickmatch(Reprog *re, char *text, Resub rs[10], int click) { char *clickp; - int i, w; + int i; Rune r; /* click is in characters, not bytes */ - for(i=0; i<click && text[i]!='\0'; i+=w) - w = chartorune(&r, text+i); - clickp = text+i; + for(i=0, clickp=text; i<click && *clickp!='\0'; i++) + clickp += chartorune(&r, clickp); for(i=0; i<=click; i++){ memset(rs, 0, 10*sizeof(Resub)); if(regexec(re, text+i, rs, 10)) |