mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
plumber: set match variables past the first non-matching subexpression
Fixes #563.
This commit is contained in:
parent
28e91cd879
commit
4f801be055
1 changed files with 6 additions and 6 deletions
|
@ -45,12 +45,12 @@ setvar(Resub rs[10], char *match[10])
|
||||||
for(i=0; i<10; i++){
|
for(i=0; i<10; i++){
|
||||||
free(match[i]);
|
free(match[i]);
|
||||||
match[i] = nil;
|
match[i] = nil;
|
||||||
}
|
if(rs[i].s.sp != nil){
|
||||||
for(i=0; i<10 && rs[i].s.sp!=nil; i++){
|
n = rs[i].e.ep-rs[i].s.sp;
|
||||||
n = rs[i].e.ep-rs[i].s.sp;
|
match[i] = emalloc(n+1);
|
||||||
match[i] = emalloc(n+1);
|
memmove(match[i], rs[i].s.sp, n);
|
||||||
memmove(match[i], rs[i].s.sp, n);
|
match[i][n] = '\0';
|
||||||
match[i][n] = '\0';
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue