diff options
Diffstat (limited to 'lvm.c')
| -rw-r--r-- | lvm.c | 10 |
1 files changed, 9 insertions, 1 deletions
| @@ -373,6 +373,14 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key, | |||
| 373 | 373 | ||
| 374 | 374 | ||
| 375 | /* | 375 | /* |
| 376 | ** Function to be used for 0-terminated string order comparison | ||
| 377 | */ | ||
| 378 | #if !defined(l_strcoll) | ||
| 379 | #define l_strcoll strcoll | ||
| 380 | #endif | ||
| 381 | |||
| 382 | |||
| 383 | /* | ||
| 376 | ** Compare two strings 'ts1' x 'ts2', returning an integer less-equal- | 384 | ** Compare two strings 'ts1' x 'ts2', returning an integer less-equal- |
| 377 | ** -greater than zero if 'ts1' is less-equal-greater than 'ts2'. | 385 | ** -greater than zero if 'ts1' is less-equal-greater than 'ts2'. |
| 378 | ** The code is a little tricky because it allows '\0' in the strings | 386 | ** The code is a little tricky because it allows '\0' in the strings |
| @@ -386,7 +394,7 @@ static int l_strcmp (const TString *ts1, const TString *ts2) { | |||
| 386 | size_t rl2; | 394 | size_t rl2; |
| 387 | const char *s2 = getlstr(ts2, rl2); | 395 | const char *s2 = getlstr(ts2, rl2); |
| 388 | for (;;) { /* for each segment */ | 396 | for (;;) { /* for each segment */ |
| 389 | int temp = strcoll(s1, s2); | 397 | int temp = l_strcoll(s1, s2); |
| 390 | if (temp != 0) /* not equal? */ | 398 | if (temp != 0) /* not equal? */ |
| 391 | return temp; /* done */ | 399 | return temp; /* done */ |
| 392 | else { /* strings are equal up to a '\0' */ | 400 | else { /* strings are equal up to a '\0' */ |
