Index: src/main/native/port/windows/hyfile.c =================================================================== --- src/main/native/port/windows/hyfile.c (revision 479921) +++ src/main/native/port/windows/hyfile.c (working copy) @@ -335,31 +335,38 @@ int len = strlen(path); int i=0; int j=0; - int lastbackslash=0; + int k=0; + int founddots=0; + int *slash = portLibrary->mem_allocate_memory(portLibrary, len); if(len >= 248){ - len =len + 5; - canonicalpath = portLibrary->mem_allocate_memory(portLibrary, len); + canonicalpath = portLibrary->mem_allocate_memory(portLibrary, len+5); strcpy(canonicalpath,"\\\\?\\"); - for(i==0,j=4;i0 || path[i-1]=='\\'){ + founddots++; + continue; } - if(path[i+1]=='.'){ - j=lastbackslash; - } } - else{ - if(path[i]=='\\'){ - lastbackslash = i; + if(path[i]=='\\'){ + if(founddots == 1){ + founddots = 0; + continue; + }else if (founddots > 1){ + j=slash[k-2]; + k--; + }else{ + slash[k++]=j; } - canonicalpath[j]=path[i]; - j++; - } + } + canonicalpath[j]=path[i]; + j++; + founddots = 0; } canonicalpath[j]='\0'; returnVar = CreateDirectory (canonicalpath, 0); portLibrary->mem_free_memory(portLibrary, canonicalpath); + portLibrary->mem_free_memory(portLibrary, slash); }else{ returnVar = CreateDirectory (path, 0); }