Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
3ace87e3
Commit
3ace87e3
authored
Mar 16, 1994
by
Karl Heuer
Browse files
(Ffile_modes) [MSDOS]: set exec-bit based on file suffix.
parent
a7d40caa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
src/fileio.c
src/fileio.c
+13
-0
No files found.
src/fileio.c
View file @
3ace87e3
...
...
@@ -2352,6 +2352,19 @@ DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0,
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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment