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 <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2020-01-28 21:59:22 +01:00
parent 13d75fce48
commit 13bfb3c63f
9 changed files with 14 additions and 49 deletions

View File

@ -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"}}},

View File

@ -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:
{

View File

@ -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))

View File

@ -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;

View File

@ -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);

View File

@ -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 */

View File

@ -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",

View File

@ -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);

View File

@ -15,12 +15,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.
@ -131,6 +125,11 @@ explicitly in the open(2) call.
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