public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: stop handling files with .com suffix like .exe files
@ 2022-10-28 10:49 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2022-10-28 10:49 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=339bb6e932f4aef047dc6aa1a1894eec8b37063c

commit 339bb6e932f4aef047dc6aa1a1894eec8b37063c
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Fri Oct 28 12:42:51 2022 +0200

    Cygwin: stop handling files with .com suffix like .exe files
    
    .com is a remnant from the past.  There are only five executables
    left:
    
      chcp.com
      format.com
      mode.com
      more.com
      tree.com
    
    Calling them on the command line already requires to use the
    suffix anyway.  So drop useless .com test from the execve test
    for scripts (they are handled earlier in the same function
    as executables) and do not handle them like .exe suffixes in
    other functions.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler/disk_file.cc | 3 +--
 winsup/cygwin/globals.cc            | 1 -
 winsup/cygwin/release/3.4.0         | 3 +++
 winsup/cygwin/spawn.cc              | 3 ---
 winsup/cygwin/syscalls.cc           | 1 -
 5 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/winsup/cygwin/fhandler/disk_file.cc b/winsup/cygwin/fhandler/disk_file.cc
index 62c18e5e4..6eb466e9c 100644
--- a/winsup/cygwin/fhandler/disk_file.cc
+++ b/winsup/cygwin/fhandler/disk_file.cc
@@ -518,8 +518,7 @@ fhandler_base::fstat_helper (struct stat *buf)
 	      PUNICODE_STRING path = pc.get_nt_native_path ();
 
 	      if (RtlEqualUnicodePathSuffix (path, &ro_u_exe, TRUE)
-		  || RtlEqualUnicodePathSuffix (path, &ro_u_lnk, TRUE)
-		  || RtlEqualUnicodePathSuffix (path, &ro_u_com, TRUE))
+		  || RtlEqualUnicodePathSuffix (path, &ro_u_lnk, TRUE))
 		pc.set_exec ();
 	    }
 	  /* No known suffix, check file header.  This catches binaries and
diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc
index e909d0f8f..aef4a687d 100644
--- a/winsup/cygwin/globals.cc
+++ b/winsup/cygwin/globals.cc
@@ -120,7 +120,6 @@ const int __collate_load_error = 0;
   extern UNICODE_STRING _RDATA ro_u_empty = _ROU (L"");
   extern UNICODE_STRING _RDATA ro_u_lnk = _ROU (L".lnk");
   extern UNICODE_STRING _RDATA ro_u_exe = _ROU (L".exe");
-  extern UNICODE_STRING _RDATA ro_u_com = _ROU (L".com");
   extern UNICODE_STRING _RDATA ro_u_scr = _ROU (L".scr");
   extern UNICODE_STRING _RDATA ro_u_sys = _ROU (L".sys");
   extern UNICODE_STRING _RDATA ro_u_proc = _ROU (L"proc");
diff --git a/winsup/cygwin/release/3.4.0 b/winsup/cygwin/release/3.4.0
index e3b3072b4..a5e9a8ae3 100644
--- a/winsup/cygwin/release/3.4.0
+++ b/winsup/cygwin/release/3.4.0
@@ -5,6 +5,9 @@ What's new:
 
 - Drop support for 32 bit Windows and WOW64.
 
+- Remove any special handling for the .com filename suffix. It has to
+  be used always explicitely.
+
 - Add code to handle setrlimit(RLIMIT_AS).
 
 - Add code to handle signal masks in /proc/<PID>/status.
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index f0ae73999..01225afe2 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -34,7 +34,6 @@ static const suffix_info exe_suffixes[] =
 {
   suffix_info ("", 1),
   suffix_info (".exe", 1),
-  suffix_info (".com"),
   suffix_info (NULL)
 };
 
@@ -1366,8 +1365,6 @@ av::setup (const char *prog_arg, path_conv& real_path, const char *ext,
 		set_errno (ENOEXEC);
 		return -1;
 	      }
-	    if (ascii_strcasematch (ext, ".com"))
-	      break;
 	    pgm = (char *) "/bin/sh";
 	    arg1 = NULL;
 	  }
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 1338853df..fff8af009 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -2097,7 +2097,6 @@ nt_path_has_executable_suffix (PUNICODE_STRING upath)
 {
   static const PUNICODE_STRING blessed_executable_suffixes[] =
   {
-    &ro_u_com,
     &ro_u_exe,
     &ro_u_scr,
     &ro_u_sys,

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-28 10:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-28 10:49 [newlib-cygwin] Cygwin: stop handling files with .com suffix like .exe files Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).