16
16
* https://github.com/sfeakes/aqualinkd
17
17
*/
18
18
19
-
19
+ #define _GNU_SOURCE 1 // for strcasestr
20
20
#include <stdbool.h>
21
21
#include <stdio.h>
22
22
#include <string.h>
@@ -83,6 +83,7 @@ int pda_find_m_index(char *text)
83
83
int i ;
84
84
85
85
for (i = 0 ; i < PDA_LINES ; i ++ ) {
86
+ //printf ("+++ pda_find_m_index() Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
86
87
if (strncmp (pda_m_line (i ), text , strlen (text )) == 0 )
87
88
return i ;
88
89
}
@@ -96,7 +97,7 @@ int pda_find_m_index_case(char *text, int limit)
96
97
int i ;
97
98
98
99
for (i = 0 ; i < PDA_LINES ; i ++ ) {
99
- //printf ("+++ Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
100
+ //printf ("+++ pda_find_m_index_case() Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
100
101
if (strncasecmp (pda_m_line (i ), text , limit ) == 0 )
101
102
return i ;
102
103
}
@@ -110,8 +111,9 @@ int pda_find_m_index_loose(char *text)
110
111
int i ;
111
112
112
113
for (i = 0 ; i < PDA_LINES ; i ++ ) {
113
- //printf ("+++ Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
114
- if (strstr (pda_m_line (i ), text ) != NULL )
114
+ //printf ("+++ pda_find_m_index_loose() Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
115
+ //if (strstr(pda_m_line(i), text) != NULL)
116
+ if (strcasestr (pda_m_line (i ), text ) != NULL )
115
117
return i ;
116
118
}
117
119
@@ -180,7 +182,7 @@ pda_menu_type pda_m_type()
180
182
} else if (strncasecmp (_menu [0 ]," LABEL AUX" , 12 ) == 0 && // Will have number ie AUX4
181
183
strncasecmp (_menu [2 ]," CURRENT LABEL " , 16 ) == 0 ) {
182
184
return PM_AUX_LABEL_DEVICE ;
183
- } else if (strstr (_menu [0 ],"BOOST" )) { // This is bad check, but PDA menus are BOOST | BOOST POOL | BOOST SPA, need to do better.
185
+ } else if (strcasestr (_menu [0 ],"BOOST" )) { // This is bad check, but PDA menus are BOOST | Boost | BOOST POOL | BOOST SPA, need to do better.
184
186
return PM_BOOST ;
185
187
}
186
188
return PM_UNKNOWN ;
0 commit comments