* path.cc (special_name): Accommodate all special names with extensions.

This commit is contained in:
Christopher Faylor 2003-08-17 16:33:15 +00:00
parent 597b518cb9
commit 293ce8104d
2 changed files with 23 additions and 21 deletions

View File

@ -1,3 +1,8 @@
2003-08-17 Christopher Faylor <cgf@redhat.com>
* path.cc (special_name): Accommodate all special names with
extensions.
2003-08-15 Corinna Vinschen <corinna@vinschen.de> 2003-08-15 Corinna Vinschen <corinna@vinschen.de>
* mmap.cc (mmap64): Avoid crash if file size is less than requested * mmap.cc (mmap64): Avoid crash if file size is less than requested
@ -10,7 +15,7 @@
2003-08-13 Corinna Vinschen <corinna@vinschen.de> 2003-08-13 Corinna Vinschen <corinna@vinschen.de>
* cygwin.din: Accomodate change from cygwin_lstat to lstat. * cygwin.din: Accommodate change from cygwin_lstat to lstat.
* syscalls.cc: Add defines to avoid declaration issues when * syscalls.cc: Add defines to avoid declaration issues when
renaming cygwin_lstat back to lstat. renaming cygwin_lstat back to lstat.
(lstat): Reverted name change from cygwin_lstat. (lstat): Reverted name change from cygwin_lstat.
@ -740,7 +745,7 @@
* shared_info.h: Match shared_name declaration with below change. * shared_info.h: Match shared_name declaration with below change.
* shared.cc (shared_name): Use incoming char * parameter instead of * shared.cc (shared_name): Use incoming char * parameter instead of
local static buffer. local static buffer.
(open_shared): Accomodate new calling convention for shared_name. (open_shared): Accommodate new calling convention for shared_name.
* exceptions.cc (events_init): Ditto. * exceptions.cc (events_init): Ditto.
* sigproc.cc (getsem): Ditto. * sigproc.cc (getsem): Ditto.
* syscalls.cc (login): Ditto. * syscalls.cc (login): Ditto.
@ -751,7 +756,7 @@
* fhandler_socket.cc (secret_event_name): Return void. Use incoming * fhandler_socket.cc (secret_event_name): Return void. Use incoming
char * parameter instead of local static buffer. char * parameter instead of local static buffer.
(fhandler_socket::create_secret_event): Accomodate new calling (fhandler_socket::create_secret_event): Accommodate new calling
convention for secret_event_name. convention for secret_event_name.
(fhandler_socket::close_secret_event): Ditto. (fhandler_socket::close_secret_event): Ditto.
@ -770,7 +775,7 @@
* wincap.cc: Set has_terminal_services capability throughout. * wincap.cc: Set has_terminal_services capability throughout.
(wincap_2003): New global object representing Windows 2003 Server (wincap_2003): New global object representing Windows 2003 Server
capabilities. capabilities.
(wincapc::init): Accomodate Windows 2003 Server. (wincapc::init): Accommodate Windows 2003 Server.
* wincap.h (struct wincaps): Add has_terminal_services capability. * wincap.h (struct wincaps): Add has_terminal_services capability.
2003-05-20 Charles Wilson <cygwin@cwilson.fastmail.fm> 2003-05-20 Charles Wilson <cygwin@cwilson.fastmail.fm>
@ -2222,7 +2227,7 @@
(mmap_record::fixup_map): Format change. (mmap_record::fixup_map): Format change.
(list::add_record): Add offset and length parameter to call (list::add_record): Add offset and length parameter to call
mmap_record::alloc_map() correctly. mmap_record::alloc_map() correctly.
(mmap64): Rename `l' variable to `map_list'. Accomodate above changes. (mmap64): Rename `l' variable to `map_list'. Accommodate above changes.
(munmap): Rename `l' variable to `map_list'. (munmap): Rename `l' variable to `map_list'.
(msync): Ditto. (msync): Ditto.
(fhandler_disk_file::mmap): Streamline code. (fhandler_disk_file::mmap): Streamline code.

View File

@ -1418,24 +1418,21 @@ special_name (const char *s, int inc = 1)
if (strpbrk (s, special_chars)) if (strpbrk (s, special_chars))
return !strncasematch (s, "%2f", 3); return !strncasematch (s, "%2f", 3);
// FIXME: add com0 and {com,lpt}N.* const char *p;
if (strcasematch (s, "nul") if (strcasematch (s, "conin$") || strcasematch (s, "conout$"))
|| strncasematch (s, "nul.", 4)
|| strcasematch (s, "aux")
|| strncasematch (s, "aux.", 4)
|| strcasematch (s, "prn")
|| strncasematch (s, "prn.", 4)
|| strcasematch (s, "con")
|| strncasematch (s, "con.", 4)
|| strcasematch (s, "conin$")
|| strcasematch (s, "conout$"))
return -1; return -1;
if (!strncasematch (s, "com", 3)
&& !strncasematch (s, "lpt", 3)) if (strncasematch (s, "nul", 3)
|| strncasematch (s, "aux", 3)
|| strncasematch (s, "prn", 3)
|| strncasematch (s, "con", 3))
p = s + 3;
else if (strncasematch (s, "com", 3) || strncasematch (s, "lpt", 3))
(void) strtoul (s + 3, (char **) &p, 10);
else
return false; return false;
char *p;
(void) strtoul (s + 3, &p, 10); return (*p == '\0' || *p == '.') ? -1 : false;
return -(*p == '\0');
} }
bool bool