diff options
| author | Roberto I <roberto@inf.puc-rio.br> | 2025-12-23 14:44:06 -0300 |
|---|---|---|
| committer | Roberto I <roberto@inf.puc-rio.br> | 2025-12-23 14:44:06 -0300 |
| commit | 578ae5745cecee56d48795cd4ae1eaf13618715c (patch) | |
| tree | 3c140dfd5e215fa162d440da480e0aa66cbb05c3 /lstrlib.c | |
| parent | a5522f06d2679b8f18534fd6a9968f7eb539dc31 (diff) | |
| download | lua-578ae5745cecee56d48795cd4ae1eaf13618715c.tar.gz lua-578ae5745cecee56d48795cd4ae1eaf13618715c.tar.bz2 lua-578ae5745cecee56d48795cd4ae1eaf13618715c.zip | |
Details
typo in comment + formatting + logical 'and' was written as a bitwise
operation (makes code more fragile)
Diffstat (limited to '')
| -rw-r--r-- | lstrlib.c | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -968,7 +968,7 @@ static int str_gsub (lua_State *L) { | |||
| 968 | reprepstate(&ms); /* (re)prepare state for new match */ | 968 | reprepstate(&ms); /* (re)prepare state for new match */ |
| 969 | if ((e = match(&ms, src, p)) != NULL && e != lastmatch) { /* match? */ | 969 | if ((e = match(&ms, src, p)) != NULL && e != lastmatch) { /* match? */ |
| 970 | n++; | 970 | n++; |
| 971 | changed = add_value(&ms, &b, src, e, tr) | changed; | 971 | changed = add_value(&ms, &b, src, e, tr) || changed; |
| 972 | src = lastmatch = e; | 972 | src = lastmatch = e; |
| 973 | } | 973 | } |
| 974 | else if (src < ms.src_end) /* otherwise, skip one character */ | 974 | else if (src < ms.src_end) /* otherwise, skip one character */ |
