diff options
author | Christopher Faylor <me@cgf.cx> | 2009-01-09 05:18:02 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2009-01-09 05:18:02 +0000 |
commit | d95d8c5393988702112b8fcd154683150227cb7a (patch) | |
tree | 68eae25a4f9469fae8cbc227f8b4ca28e11c57e5 /winsup/cygwin/path.cc | |
parent | 086dc27fec1b3e5ff4e01404b67e02d745f01d4b (diff) | |
download | newlib-d95d8c5393988702112b8fcd154683150227cb7a.zip newlib-d95d8c5393988702112b8fcd154683150227cb7a.tar.gz newlib-d95d8c5393988702112b8fcd154683150227cb7a.tar.bz2 |
* include/sys/cygwin.h (CW_SETERRNO): Define.
* external.cc (CW_SETERRNO): Implement.
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 192 to reflect the
above change.
* path.cc (path_prefix_p): Treat X: as equivalent to x:.
* mkglobals_h: Remove unneeded #define.
* spawn.cc (spawn_guts): Avoid overly wordy initialization to zero.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index da96cde..f736be4 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -169,8 +169,20 @@ path_prefix_p (const char *path1, const char *path2, int len1, return isdirsep (path2[0]) && !isdirsep (path2[1]); if (isdirsep (path2[len1]) || path2[len1] == 0 || path1[len1 - 1] == ':') - return caseinsensitive ? strncasematch (path1, path2, len1) - : !strncmp (path1, path2, len1); + { + if (len1 < 2 || (path1[1] != ':') || (path2[1] != ':')) + /* nothing */; + else if (tolower (*path1) != tolower(*path2)) + return 0; + else + { + path1 += 2; + path2 += 2; + len1 -= 2; + } + return caseinsensitive ? strncasematch (path1, path2, len1) + : !strncmp (path1, path2, len1); + } return 0; } |