diff src/nt.c @ 819:6504113e7c2d

[xemacs-hg @ 2002-04-25 18:03:23 by andyp] sync up windows branch from 21.4
author andyp
date Thu, 25 Apr 2002 18:04:24 +0000
parents a634e3b7acc8
children e7ee5f8bde58
line wrap: on
line diff
--- a/src/nt.c	Thu Apr 25 06:09:18 2002 +0000
+++ b/src/nt.c	Thu Apr 25 18:04:24 2002 +0000
@@ -1458,6 +1458,7 @@
   Bytecount len;
   int rootdir = FALSE;
   Extbyte *nameext;
+  int errm;
 
   if (path == NULL || buf == NULL)
     {
@@ -1466,6 +1467,8 @@
     }
 
   name = qxestrcpy (alloca_intbytes (qxestrlen (path) + 10), path);
+  errm = SetErrorMode (SEM_FAILCRITICALERRORS
+		       | SEM_NOOPENFILEERRORBOX);
 
   get_volume_info (name, &path);
   /* must be valid filename, no wild cards or other invalid characters */
@@ -1511,6 +1514,7 @@
       C_STRING_TO_TSTR (name, nameext);
       if (qxeGetDriveType (nameext) < 2)
 	{
+	  SetErrorMode (errm);
 	  errno = ENOENT;
 	  return -1;
 	}
@@ -1552,6 +1556,7 @@
 	  fh = qxeFindFirstFile (nameext, &wfd);
 	  if (fh == INVALID_HANDLE_VALUE)
 	    {
+	      SetErrorMode (errm);
 	      errno = ENOENT;
 	      return -1;
 	    }
@@ -1621,6 +1626,8 @@
 	}
     }
 
+  SetErrorMode (errm);
+
 #if 0
   /* XEmacs: Removed the fake-inodes code here, which was if 0'd out.
      If you want it, look in w32.c in Emacs 20.6. */