- * *****************************************************************************/
-
-char* complete_from_list(char* completions[], const char *text, int state)
-{
- static int idx;
- if(state==0) {
- idx = 0;
- }
- for(; completions[idx]; ++ idx) {
- if(!strncmp(completions[idx],text,strlen(text))) {
- ++idx; /* skip this entry on the next run */
- return (char*)strdup(completions[idx-1]);
- };
- };
- return NULL;
+ * ***************************************************************************/
+
+char *complete_from_list(const char** completions,
+ const char *text, int state)
+{
+#if HAVE_READLINE_READLINE_H
+ static int idx;
+
+ if (!completions)
+ return NULL;
+ if (state==0)
+ idx = 0;
+ for(; completions[idx]; ++ idx) {
+ if(!
+#ifdef WIN32
+ _strnicmp
+#else
+ strncasecmp
+#endif
+ (completions[idx],text,strlen(text))) {
+ ++idx; /* skip this entry on the next run */
+ return (char*)strdup(completions[idx-1]);
+ };
+ };
+#endif
+ return NULL;