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,13 +45,13 @@ setvar(Resub rs[10], char *match[10])
|
|||
for(i=0; i<10; i++){
|
||||
free(match[i]);
|
||||
match[i] = nil;
|
||||
}
|
||||
for(i=0; i<10 && rs[i].s.sp!=nil; i++){
|
||||
if(rs[i].s.sp != nil){
|
||||
n = rs[i].e.ep-rs[i].s.sp;
|
||||
match[i] = emalloc(n+1);
|
||||
memmove(match[i], rs[i].s.sp, n);
|
||||
match[i][n] = '\0';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
|
Loading…
Reference in a new issue