src/windows/native/java/io/canonicalize_md.c

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -177,10 +177,14 @@
 /* Wide character version of dots */
 static int
 wdots(WCHAR *start)
 {
     WCHAR *p = start;
+    // Skip "\\.\" prefix
+    if (wcslen(p) > 4 && !wcsncmp(p, L"\\\\.\\", 4))
+        p = p + 4;
+
     while (*p) {
         if ((p = wcschr(p, L'.')) == NULL) // find next occurence of '.'
             return 0; // no more dots
         p++; // next char
         while ((*p) == L'.') // go to the end of dots