Skip to content

Fix failure in regmatch^%ydbposixtest due to extraneous match results (regression in 9007dec8)

Narayanan Iyer requested to merge nars1/YDBposix:regmatch into master

The v60001/gtm_posix subtest in the YDBTest repo failed after commit 9007dec8 with the following diff.

> FAIL regmatch^%ydbposix 4
> FAIL REGMATCH^%ydbposix 4

This is because that commit erroneously assumed that matchresults(i,"start") might not be set in the for loop in case $&ydbposix.regofft2offsets returned a non-zero value. And because of this, it added a $data(matchresults(i,"start")) check instead of the pre-existing 'matchresults(i,"start")) check.

Turns out $&ydbposix.regofft2offsets always returns a 0. Therefore, the $data check is not necessary and in fact incorrect since we need to actually check for 0 value of matchresults(i,"start") to terminate the for loop. This is now done. And comments added in the code to help a future reader.

Merge request reports