plumber: set match variables past the first non-matching subexpression

Fixes #563.
This commit is contained in:
Igor Burago 2022-07-27 15:51:02 +08:00 committed by Dan Cross
parent 28e91cd879
commit 4f801be055

View file

@ -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