mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-04-21 21:41:40 -07:00
(Fcopy_file): Use st_ino under DJGPP v2 and later to
prevent copying file into itself. (check_executable): DJGPP v2 `stat' doesn't need to be augmented in case of executable files. (Ffile_modes): Use `stat' results as is in DJGPP v2 and later.
This commit is contained in:
parent
ac8da9507a
commit
34ead71a13
1 changed files with 4 additions and 4 deletions
|
|
@ -2078,7 +2078,7 @@ A prefix arg makes KEEP-TIME non-nil.")
|
|||
copyable by us. */
|
||||
input_file_statable_p = (fstat (ifd, &st) >= 0);
|
||||
|
||||
#ifndef MSDOS
|
||||
#if !defined (MSDOS) || __DJGPP__ > 1
|
||||
if (out_st.st_mode != 0
|
||||
&& st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino)
|
||||
{
|
||||
|
|
@ -2534,7 +2534,7 @@ check_executable (filename)
|
|||
struct stat st;
|
||||
if (stat (filename, &st) < 0)
|
||||
return 0;
|
||||
#ifdef WINDOWSNT
|
||||
#if defined (WINDOWSNT) || (defined (MSDOS) && __DJGPP__ > 1)
|
||||
return ((st.st_mode & S_IEXEC) != 0);
|
||||
#else
|
||||
return (S_ISREG (st.st_mode)
|
||||
|
|
@ -2840,10 +2840,10 @@ DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0,
|
|||
|
||||
if (stat (XSTRING (absname)->data, &st) < 0)
|
||||
return Qnil;
|
||||
#ifdef MSDOS
|
||||
#if defined (MSDOS) && __DJGPP__ < 2
|
||||
if (check_executable (XSTRING (absname)->data))
|
||||
st.st_mode |= S_IEXEC;
|
||||
#endif /* MSDOS */
|
||||
#endif /* MSDOS && __DJGPP__ < 2 */
|
||||
|
||||
return make_number (st.st_mode & 07777);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue