0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

updated for version 7.0-130

This commit is contained in:
Bram Moolenaar
2006-10-10 16:44:07 +00:00
parent 57ac3a2163
commit 043545e0f6
6 changed files with 56 additions and 1 deletions

View File

@@ -419,6 +419,20 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
}
#endif
#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
/*
* MS-Windows allows opening a device, but we will probably get stuck
* trying to read it.
*/
if (!p_odev && mch_nodetype(fname) == NODE_WRITABLE)
{
filemess(curbuf, fname, (char_u *)_("is a device (disabled with 'opendevice' option"), 0);
msg_end();
msg_scroll = msg_save;
return FAIL;
}
#endif
/* set default 'fileformat' */
if (set_options)
{
@@ -3163,6 +3177,16 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit,
}
if (c == NODE_WRITABLE)
{
# if defined(MSDOS) || defined(MSWIN) || defined(OS2)
/* MS-Windows allows opening a device, but we will probably get stuck
* trying to write to it. */
if (!p_odev)
{
errnum = (char_u *)"E796: ";
errmsg = (char_u *)_("writing to device disabled with 'opendevice' option");
goto fail;
}
# endif
device = TRUE;
newfile = TRUE;
perm = -1;