summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 0615077b8..10a174838 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -230,7 +230,7 @@ normalize_posix_path (const char *src, char *dst, char *&tail)
*tail++ = '/';
}
/* Two leading /'s? If so, preserve them. */
- else if (isslash (src[1]) && !isslash (src[2]))
+ else if (isslash (src[1]) && src[2] && !isslash (src[2]))
{
*tail++ = '/';
*tail++ = '/';
@@ -1023,7 +1023,7 @@ normalize_win32_path (const char *src, char *dst, char *&tail)
bool beg_src_slash = isdirsep (src[0]);
tail = dst;
- if (beg_src_slash && isdirsep (src[1]))
+ if (beg_src_slash && isdirsep (src[1]) && src[2])
{
*tail++ = '\\';
src++;