Fix Nasal string.match with trailing *
As discussed in: https://sourceforge.net/p/flightgear/codetickets/2016/ Fix a bug where string.match(‘747’, ‘747*’) returned false.
This commit is contained in:
parent
74a14a7dbc
commit
bc00f8d436
1 changed files with 5 additions and 0 deletions
|
@ -177,6 +177,11 @@ match = func(str, patt) {
|
|||
s += 1;
|
||||
p += 1;
|
||||
}
|
||||
|
||||
# eat trailing * in the pattern; this is needed to fix:
|
||||
# https://sourceforge.net/p/flightgear/codetickets/2016/
|
||||
for (;p < size(patt) and patt[p] == `*`; p += 1) {}
|
||||
|
||||
return s == size(str) and p == size(patt);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue