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

commit 13bfb3c63f35d875c1771daea6de4be0176e3b13
Author: Corinna Vinschen <cori...@vinschen.de>
Date:   Tue Jan 28 21:59:22 2020 +0100

    Cygwin: remove CYGWIN=dos_file_warning option
    
    This option has been disabled long ago and nobody missed it.
    Removing drops a bit of unneeded code
    
    Signed-off-by: Corinna Vinschen <cori...@vinschen.de>

Diff:
---
 winsup/cygwin/environ.cc            |  1 -
 winsup/cygwin/external.cc           |  5 +----
 winsup/cygwin/fhandler_disk_file.cc |  2 +-
 winsup/cygwin/globals.cc            |  1 -
 winsup/cygwin/path.cc               | 36 ++++--------------------------------
 winsup/cygwin/path.h                |  1 -
 winsup/cygwin/pinfo.cc              |  4 ++--
 winsup/cygwin/quotactl.cc           |  2 +-
 winsup/doc/cygwinenv.xml            | 11 +++++------
 9 files changed, 14 insertions(+), 49 deletions(-)

diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 7eb4780..3a03657 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -111,7 +111,6 @@ static struct parse_thing
       } values[2];
   } known[] NO_COPY =
 {
-  {"dosfilewarning", {&dos_file_warning}, setbool, NULL, {{false}, {true}}},
   {"error_start", {func: error_start_init}, isfunc, NULL, {{0}, {0}}},
   {"export", {&export_settings}, setbool, NULL, {{false}, {true}}},
   {"glob", {func: glob_init}, isfunc, NULL, {{0}, {s: "normal"}}},
diff --git a/winsup/cygwin/external.cc b/winsup/cygwin/external.cc
index 94431bb..14a1dfb 100644
--- a/winsup/cygwin/external.cc
+++ b/winsup/cygwin/external.cc
@@ -452,10 +452,7 @@ cygwin_internal (cygwin_getinfo_types t, ...)
        res = CYGTLS_PADSIZE;
        break;
       case CW_SET_DOS_FILE_WARNING:
-       {
-         dos_file_warning = va_arg (arg, int);
-         res = 0;
-       }
+       res = 0;
        break;
       case CW_SET_PRIV_KEY:
        {
diff --git a/winsup/cygwin/fhandler_disk_file.cc 
b/winsup/cygwin/fhandler_disk_file.cc
index 19a1c5a..be45ad7 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -2062,7 +2062,7 @@ readdir_get_ino (const char *path, bool dot_dot)
       strcpy (c, "..");
       path = fname;
     }
-  path_conv pc (path, PC_SYM_NOFOLLOW | PC_POSIX | PC_NOWARN | PC_KEEP_HANDLE);
+  path_conv pc (path, PC_SYM_NOFOLLOW | PC_POSIX | PC_KEEP_HANDLE);
   if (pc.isspecial ())
     {
       if (!stat_worker (pc, &st))
diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc
index a9648fe..942bd1c 100644
--- a/winsup/cygwin/globals.cc
+++ b/winsup/cygwin/globals.cc
@@ -65,7 +65,6 @@ int NO_COPY dynamically_loaded;
 
 /* Some CYGWIN environment variable variables. */
 bool allow_glob = true;
-bool dos_file_warning;
 bool ignore_case_with_glob;
 bool pipe_byte;
 bool reset_com;
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 142a739..4da8884 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -532,31 +532,6 @@ path_conv::get_wide_win32_path (PWCHAR wc)
   return wc;
 }
 
-static void
-warn_msdos (const char *src)
-{
-  if (user_shared->warned_msdos || !cygwin_finished_initializing)
-    return;
-  tmp_pathbuf tp;
-  char *posix_path = tp.c_get ();
-  small_printf ("Cygwin WARNING:\n");
-  if (cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_RELATIVE, src,
-                       posix_path, NT_MAX_PATH))
-    small_printf (
-"  MS-DOS style path detected: %ls\n  POSIX equivalent preferred.\n",
-                 src);
-  else
-    small_printf (
-"  MS-DOS style path detected: %ls\n"
-"  Preferred POSIX equivalent is: %ls\n",
-                 src, posix_path);
-  small_printf (
-"  CYGWIN environment variable option \"nodosfilewarning\" turns off this\n"
-"  warning.  Consult the user's guide for more details about POSIX paths:\n"
-"  http://cygwin.com/cygwin-ug-net/using.html#using-pathnames\n";);
-  user_shared->warned_msdos = true;
-}
-
 static DWORD
 getfileattr (const char *path, bool caseinsensitive) /* path has to be always 
absolute. */
 {
@@ -1253,8 +1228,6 @@ path_conv::check (const char *src, unsigned opt,
          if (tail < path_end && tail > path_copy + 1)
            *tail = '/';
          set_posix (path_copy);
-         if (is_msdos && dos_file_warning && !(opt & PC_NOWARN))
-           warn_msdos (src);
        }
 
 #if 0
@@ -1916,8 +1889,7 @@ symlink_worker (const char *oldpath, path_conv 
&win32_newpath, bool isdevice)
        {
          char *newplnk = tp.c_get ();
          stpcpy (stpcpy (newplnk, win32_newpath.get_posix ()), ".lnk");
-         win32_newpath.check (newplnk, PC_SYM_NOFOLLOW | PC_POSIX
-                                       | (isdevice ? PC_NOWARN : 0));
+         win32_newpath.check (newplnk, PC_SYM_NOFOLLOW | PC_POSIX);
        }
 
       if (win32_newpath.error)
@@ -3492,7 +3464,7 @@ cygwin_conv_path (cygwin_conv_path_t what, const void 
*from, void *to,
          {
            p.check ((const char *) from,
                     PC_POSIX | PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP
-                    | PC_NO_ACCESS_CHECK | PC_NOWARN
+                    | PC_NO_ACCESS_CHECK
                     | ((how & CCP_RELATIVE) ? PC_NOFULL : 0), stat_suffixes);
            if (p.error)
              {
@@ -3537,7 +3509,7 @@ cygwin_conv_path (cygwin_conv_path_t what, const void 
*from, void *to,
        case CCP_POSIX_TO_WIN_W:
          p.check ((const char *) from,
                   PC_POSIX | PC_SYM_FOLLOW | PC_SYM_NOFOLLOW_REP
-                  | PC_NO_ACCESS_CHECK | PC_NOWARN
+                  | PC_NO_ACCESS_CHECK
                   | ((how & CCP_RELATIVE) ? PC_NOFULL : 0), stat_suffixes);
          if (p.error)
            {
@@ -3550,7 +3522,7 @@ cygwin_conv_path (cygwin_conv_path_t what, const void 
*from, void *to,
            {
              /* Recreate as absolute path. */
              p.check ((const char *) from, PC_POSIX | PC_SYM_FOLLOW
-                                           | PC_NO_ACCESS_CHECK | PC_NOWARN);
+                                           | PC_NO_ACCESS_CHECK);
              if (p.error)
                {
                  set_errno (p.error);
diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h
index a7debc1..b94f13d 100644
--- a/winsup/cygwin/path.h
+++ b/winsup/cygwin/path.h
@@ -53,7 +53,6 @@ enum pathconv_arg
   PC_NULLEMPTY          = _BIT ( 5),   /* empty path is no error */
   PC_NONULLEMPTY        = _BIT ( 6),   /* override PC_NULLEMPTY default */
   PC_POSIX              = _BIT ( 7),   /* return normalized posix path */
-  PC_NOWARN             = _BIT ( 8),   /* don't emit ms-dos path warning */
   PC_OPEN               = _BIT ( 9),   /* use open semantics */
   PC_CTTY               = _BIT (10),   /* could later be used as ctty */
   PC_SYM_NOFOLLOW_PROCFD = _BIT (11),  /* allow /proc/PID/fd redirection */
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 800adbf..06a2eee 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -120,12 +120,12 @@ pinfo::status_exit (DWORD x)
       {
        path_conv pc;
        if (!procinfo)
-          pc.check ("/dev/null", PC_NOWARN | PC_POSIX);
+          pc.check ("/dev/null", PC_POSIX);
        else
          {
            UNICODE_STRING uc;
            RtlInitUnicodeString(&uc, procinfo->progname);
-           pc.check (&uc, PC_NOWARN | PC_POSIX);
+           pc.check (&uc, PC_POSIX);
          }
        small_printf ("%s: error while loading shared libraries: %s: cannot "
                      "open shared object file: No such file or directory\n",
diff --git a/winsup/cygwin/quotactl.cc b/winsup/cygwin/quotactl.cc
index e69acfb..53513ae 100644
--- a/winsup/cygwin/quotactl.cc
+++ b/winsup/cygwin/quotactl.cc
@@ -89,7 +89,7 @@ quotactl (int cmd, const char *special, int id, caddr_t addr)
       return -1;
     }
   /* Check path */
-  pc.check (special, PC_SYM_FOLLOW | PC_NOWARN, stat_suffixes);
+  pc.check (special, PC_SYM_FOLLOW, stat_suffixes);
   if (pc.error)
     {
       set_errno (pc.error);
diff --git a/winsup/doc/cygwinenv.xml b/winsup/doc/cygwinenv.xml
index 67592cb..f549fee 100644
--- a/winsup/doc/cygwinenv.xml
+++ b/winsup/doc/cygwinenv.xml
@@ -16,12 +16,6 @@ by prefixing with <literal>no</literal>.</para>
 <itemizedlist mark="bullet">
 
 <listitem>
-<para><envar>(no)dosfilewarning</envar> - If set, Cygwin will warn the
-first time a user uses an "MS-DOS" style path name rather than a POSIX-style
-path name.  Defaults to off.</para>
-</listitem>
-
-<listitem>
 <para><envar>(no)export</envar> - If set, the final values of these
 settings are re-exported to the environment as <envar>CYGWIN</envar> again.
 Defaults to off.</para>
@@ -132,6 +126,11 @@ option has been reported in years.</para>
 </listitem>
 
 <listitem>
+<para><envar>(no)dosfilewarning</envar> - This option had been disabled for
+quite some time and nobody missed it.</para>
+</listitem>
+
+<listitem>
 <para><envar>check_case</envar> - This option has been removed in favor of
 real case sensitivity and the per-mount option "posix=[0|1]".  For more
 information, read the documentation in <xref linkend="mount-table"></xref> and

Reply via email to