• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision05942d8a1b618e1c850b67ad76374f8c59743df5 (tree)
l'heure2014-12-31 04:14:25
AuteurEli Zaretskii <eliz@gnu....>
CommiterEli Zaretskii

Message de Log

Fix executable indicator in file name completion on Windows.

* complete.c (stat_char) [_WIN32]: Don't use 'access' and X_OK on
Windows, they don't work. Instead, look at the file-name
extension to determine whether the file is executable.

Change Summary

Modification

--- a/readline/ChangeLog.gdb
+++ b/readline/ChangeLog.gdb
@@ -1,3 +1,9 @@
1+2014-12-30 Eli Zaretskii <eliz@gnu.org>
2+
3+ * complete.c (stat_char) [_WIN32]: Don't use 'access' and X_OK on
4+ Windows, they don't work. Instead, look at the file-name
5+ extension to determine whether the file is executable.
6+
17 2014-09-22 Chen Gang <gang.chen.5i5j@gmail.com>
28
39 Pushed by Joel Brobecker <brobecker@adacore.com>
--- a/readline/complete.c
+++ b/readline/complete.c
@@ -598,8 +598,21 @@ stat_char (filename)
598598 #endif
599599 else if (S_ISREG (finfo.st_mode))
600600 {
601+#if defined (_WIN32) && !defined (__CYGWIN__)
602+ /* Windows 'access' doesn't support X_OK and on latest Windows
603+ versions even invokes an invalid parameter exception. */
604+ char *ext = strrchr (filename, '.');
605+
606+ if (ext
607+ && (_rl_stricmp (ext, ".exe") == 0
608+ || _rl_stricmp (ext, ".cmd") == 0
609+ || _rl_stricmp (ext, ".bat") == 0
610+ || _rl_stricmp (ext, ".com") == 0))
611+ character = '*';
612+#else
601613 if (access (filename, X_OK) == 0)
602614 character = '*';
615+#endif
603616 }
604617 return (character);
605618 }