Mercurial > emacs
changeset 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 | bc29c7cef66a |
children | ec5ce3eb24f3 |
files | src/w32.c |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
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;