Skip to content

Commit c0fae59

Browse files
committed
add portable version of stricmp for node builds
1 parent 745ade0 commit c0fae59

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

include/ls_task.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4653,7 +4653,18 @@ int find_next_marker(PLTS_T pLts_t,int pos)
46534653

46544654
#include "proverbs.h"
46554655

4656-
#define stricmp strcasecmp
4656+
//#define stricmp strcasecmp
4657+
// portable version of stricmp - ByteSizedFox
4658+
#include <ctype.h>
4659+
static int stricmp(const char *a, const char *b) {
4660+
while (*a && *b) {
4661+
int diff = tolower((unsigned char)*a) - tolower((unsigned char)*b);
4662+
if (diff != 0) return diff;
4663+
a++;
4664+
b++;
4665+
}
4666+
return tolower((unsigned char)*a) - tolower((unsigned char)*b);
4667+
}
46574668

46584669
int ls_task_find_verb_particles(LPTTS_HANDLE_T phTTS,LETTER *word_start,LETTER *word_end)
46594670
{

0 commit comments

Comments
 (0)