Revert "Sync readline/ to version 7.0 alpha"
[deliverable/binutils-gdb.git] / readline / complete.c
index 7a1e6d98c57f57f5215165fbae78f4a43de99228..a5ce8039e5010ca9ce5193941f2ab386a87f39c2 100644 (file)
@@ -598,8 +598,21 @@ stat_char (filename)
 #endif
   else if (S_ISREG (finfo.st_mode))
     {
+#if defined (_WIN32) && !defined (__CYGWIN__)
+      /* Windows 'access' doesn't support X_OK and on latest Windows
+        versions even invokes an invalid parameter exception.  */
+      char *ext = strrchr (filename, '.');
+
+      if (ext
+         && (_rl_stricmp (ext, ".exe") == 0
+             || _rl_stricmp (ext, ".cmd") == 0
+             || _rl_stricmp (ext, ".bat") == 0
+             || _rl_stricmp (ext, ".com") == 0))
+       character = '*';
+#else
       if (access (filename, X_OK) == 0)
        character = '*';
+#endif
     }
   return (character);
 }
@@ -1994,8 +2007,7 @@ rl_completion_matches (text, entry_function)
   match_list[1] = (char *)NULL;
 
   _rl_interrupt_immediately++;
-  while (string = (*entry_function) (text, matches)
-         && matches <= rl_completion_query_items)
+  while (string = (*entry_function) (text, matches))
     {
       if (matches + 1 == match_list_size)
        match_list = (char **)xrealloc
This page took 0.024659 seconds and 4 git commands to generate.