diff src/w32.c @ 22039:c33bec4d9e67

(stat, get_long_basename): Fail if filename contains any characters that are illegal in file names.
author Richard M. Stallman <rms@gnu.org>
date Tue, 12 May 1998 21:33:44 +0000
parents c11ef8945466
children 83928cc3329e
line wrap: on
line diff
--- a/src/w32.c	Tue May 12 20:15:27 1998 +0000
+++ b/src/w32.c	Tue May 12 21:33:44 1998 +0000
@@ -464,6 +464,10 @@
   HANDLE dir_handle;
   int len = 0;
 
+  /* must be valid filename, no wild cards or other illegal characters */
+  if (strpbrk (name, "*?|<>\""))
+    return 0;
+
   dir_handle = FindFirstFile (name, &find_data);
   if (dir_handle != INVALID_HANDLE_VALUE)
     {
@@ -1639,8 +1643,8 @@
     }
 
   name = (char *) map_w32_filename (path, &path);
-  /* must be valid filename, no wild cards */
-  if (strchr (name, '*') || strchr (name, '?'))
+  /* must be valid filename, no wild cards or other illegal characters */
+  if (strpbrk (name, "*?|<>\""))
     {
       errno = ENOENT;
       return -1;