jdk/src/windows/native/java/io/canonicalize_md.c
changeset 21278 ef8a3a2a72f2
parent 19418 bb4ae810197e
equal deleted inserted replaced
21277:bd380b80f9ea 21278:ef8a3a2a72f2
   159 static int
   159 static int
   160 dots(char *start)
   160 dots(char *start)
   161 {
   161 {
   162     char *p = start;
   162     char *p = start;
   163     while (*p) {
   163     while (*p) {
   164         if ((p = strchr(p, '.')) == NULL) // find next occurence of '.'
   164         if ((p = strchr(p, '.')) == NULL) // find next occurrence of '.'
   165             return 0; // no more dots
   165             return 0; // no more dots
   166         p++; // next char
   166         p++; // next char
   167         while ((*p) == '.') // go to the end of dots
   167         while ((*p) == '.') // go to the end of dots
   168             p++;
   168             p++;
   169         if (*p && (*p != '\\')) // path element does not end with a dot
   169         if (*p && (*p != '\\')) // path element does not end with a dot
   182     // Skip "\\.\" prefix
   182     // Skip "\\.\" prefix
   183     if (wcslen(p) > 4 && !wcsncmp(p, L"\\\\.\\", 4))
   183     if (wcslen(p) > 4 && !wcsncmp(p, L"\\\\.\\", 4))
   184         p = p + 4;
   184         p = p + 4;
   185 
   185 
   186     while (*p) {
   186     while (*p) {
   187         if ((p = wcschr(p, L'.')) == NULL) // find next occurence of '.'
   187         if ((p = wcschr(p, L'.')) == NULL) // find next occurrence of '.'
   188             return 0; // no more dots
   188             return 0; // no more dots
   189         p++; // next char
   189         p++; // next char
   190         while ((*p) == L'.') // go to the end of dots
   190         while ((*p) == L'.') // go to the end of dots
   191             p++;
   191             p++;
   192         if (*p && (*p != L'\\')) // path element does not end with a dot
   192         if (*p && (*p != L'\\')) // path element does not end with a dot