Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-08-17 20:33:15 +0400
committerChristopher Faylor <me@cgf.cx>2003-08-17 20:33:15 +0400
commit293ce8104da2b49fde7682913264339df7b70cd4 (patch)
tree7004923c4a075e7936da231ee733d0ad1c38c6e7 /winsup/cygwin
parent597b518cb9f90c37bff84a44edf503a9a37d50f4 (diff)
* path.cc (special_name): Accommodate all special names with extensions.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog15
-rw-r--r--winsup/cygwin/path.cc29
2 files changed, 23 insertions, 21 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ed37e0b4d..6debe68a4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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>
* mmap.cc (mmap64): Avoid crash if file size is less than requested
@@ -10,7 +15,7 @@
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
renaming cygwin_lstat back to lstat.
(lstat): Reverted name change from cygwin_lstat.
@@ -740,7 +745,7 @@
* shared_info.h: Match shared_name declaration with below change.
* shared.cc (shared_name): Use incoming char * parameter instead of
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.
* sigproc.cc (getsem): Ditto.
* syscalls.cc (login): Ditto.
@@ -751,7 +756,7 @@
* fhandler_socket.cc (secret_event_name): Return void. Use incoming
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.
(fhandler_socket::close_secret_event): Ditto.
@@ -770,7 +775,7 @@
* wincap.cc: Set has_terminal_services capability throughout.
(wincap_2003): New global object representing Windows 2003 Server
capabilities.
- (wincapc::init): Accomodate Windows 2003 Server.
+ (wincapc::init): Accommodate Windows 2003 Server.
* wincap.h (struct wincaps): Add has_terminal_services capability.
2003-05-20 Charles Wilson <cygwin@cwilson.fastmail.fm>
@@ -2222,7 +2227,7 @@
(mmap_record::fixup_map): Format change.
(list::add_record): Add offset and length parameter to call
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'.
(msync): Ditto.
(fhandler_disk_file::mmap): Streamline code.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 7241994a2..bffddce9b 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -1418,24 +1418,21 @@ special_name (const char *s, int inc = 1)
if (strpbrk (s, special_chars))
return !strncasematch (s, "%2f", 3);
- // FIXME: add com0 and {com,lpt}N.*
- if (strcasematch (s, "nul")
- || 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$"))
+ const char *p;
+ if (strcasematch (s, "conin$") || strcasematch (s, "conout$"))
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;
- char *p;
- (void) strtoul (s + 3, &p, 10);
- return -(*p == '\0');
+
+ return (*p == '\0' || *p == '.') ? -1 : false;
}
bool