Mercurial > emacs
changeset 6383:62db5566c287
(Ffile_modes) [MSDOS]: set exec-bit based on file suffix.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Wed, 16 Mar 1994 22:14:23 +0000 |
parents | 16e6eb4c5afa |
children | 5e8a442a836d |
files | src/fileio.c |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/fileio.c Wed Mar 16 22:14:06 1994 +0000 +++ b/src/fileio.c Wed Mar 16 22:14:23 1994 +0000 @@ -2352,6 +2352,19 @@ if (stat (XSTRING (abspath)->data, &st) < 0) return Qnil; +#ifdef MSDOS + { + int len; + char *suffix; + if (S_ISREG (st.st_mode) + && (len = XSTRING (abspath)->size) >= 5 + && (stricmp ((suffix = XSTRING (abspath)->data + len-4), ".com") == 0 + || stricmp (suffix, ".exe") == 0 + || stricmp (suffix, ".bat") == 0)) + st.st_mode |= S_IEXEC; + } +#endif /* MSDOS */ + return make_number (st.st_mode & 07777); }