- New macro l_strcoll to ease changing 'strcoll' to something else.
- MAXINDEXRK==1 in 'ltests.h' is enough to run test 'code.lua'.
- Removed unused '#include' in 'lutf8lib.c'.
This commit is contained in:
Roberto I
2025-10-31 14:48:55 -03:00
parent d342328e5b
commit f791bb6906
3 changed files with 10 additions and 8 deletions

10
lvm.c
View File

@@ -372,6 +372,14 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
}
/*
** Function to be used for 0-terminated string order comparison
*/
#if !defined(l_strcoll)
#define l_strcoll strcoll
#endif
/*
** Compare two strings 'ts1' x 'ts2', returning an integer less-equal-
** -greater than zero if 'ts1' is less-equal-greater than 'ts2'.
@@ -386,7 +394,7 @@ static int l_strcmp (const TString *ts1, const TString *ts2) {
size_t rl2;
const char *s2 = getlstr(ts2, rl2);
for (;;) { /* for each segment */
int temp = strcoll(s1, s2);
int temp = l_strcoll(s1, s2);
if (temp != 0) /* not equal? */
return temp; /* done */
else { /* strings are equal up to a '\0' */