(EMACS_TIME_NEG_P): Cast to signed.
[bpt/emacs.git] / src / fileio.c
index 3929cbd..a6232e1 100644 (file)
@@ -1715,8 +1715,8 @@ A prefix arg makes KEEP-TIME non-nil.")
   if (NILP (handler))
     handler = Ffind_file_name_handler (newname);
   if (!NILP (handler))
-    return RETURN_UNGCPRO (call5 (handler, Qcopy_file, filename, newname,
-                                 ok_if_already_exists, keep_date));
+    RETURN_UNGCPRO (call5 (handler, Qcopy_file, filename, newname,
+                          ok_if_already_exists, keep_date));
 
   if (NILP (ok_if_already_exists)
       || XTYPE (ok_if_already_exists) == Lisp_Int)
@@ -1890,8 +1890,8 @@ This is what happens in interactive use with M-x.")
   if (NILP (handler))
     handler = Ffind_file_name_handler (newname);
   if (!NILP (handler))
-    return RETURN_UNGCPRO (call4 (handler, Qrename_file,
-                                 filename, newname, ok_if_already_exists));
+    RETURN_UNGCPRO (call4 (handler, Qrename_file,
+                          filename, newname, ok_if_already_exists));
 
   if (NILP (ok_if_already_exists)
       || XTYPE (ok_if_already_exists) == Lisp_Int)
@@ -1953,8 +1953,8 @@ This is what happens in interactive use with M-x.")
      call the corresponding file handler.  */
   handler = Ffind_file_name_handler (filename);
   if (!NILP (handler))
-    return RETURN_UNGCPRO (call4 (handler, Qadd_name_to_file, filename,
-                                 newname, ok_if_already_exists));
+    RETURN_UNGCPRO (call4 (handler, Qadd_name_to_file, filename,
+                          newname, ok_if_already_exists));
 
   if (NILP (ok_if_already_exists)
       || XTYPE (ok_if_already_exists) == Lisp_Int)
@@ -2007,8 +2007,8 @@ This happens for interactive use with M-x.")
      call the corresponding file handler.  */
   handler = Ffind_file_name_handler (filename);
   if (!NILP (handler))
-    return RETURN_UNGCPRO (call4 (handler, Qmake_symbolic_link, filename,
-                                 linkname, ok_if_already_exists));
+    RETURN_UNGCPRO (call4 (handler, Qmake_symbolic_link, filename,
+                          linkname, ok_if_already_exists));
 
   if (NILP (ok_if_already_exists)
       || XTYPE (ok_if_already_exists) == Lisp_Int)
@@ -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);
 }
 
@@ -2750,7 +2763,8 @@ and (2) it puts less data in the undo list.")
      is deemed to be a text file.  */
   {
     struct gcpro gcpro1;
-    Lisp_Object code = Qnil;
+    Lisp_Object code;
+    code = Qnil;
     GCPRO1 (filename);
     code = call1 (Qfind_buffer_file_type, filename);
     UNGCPRO;