src/windows/native/java/io/canonicalize_md.c
static int
dots(char *start)
{
    char *p = start;
    while (*p) {
        if ((p = strchr(p, '.')) == NULL) // find next occurrence of '.'
            return 0; // no more dots
        p++; // next char
        while ((*p) == '.') // go to the end of dots
            p++;
        if (*p && (*p != '\\')) // path element does not end with a dot
            p++; // go to the next char
        else
            return 1; // path element does end with a dot - prohibited
    }
    return 0; // no prohibited combinations of dots found
}
/* Tell whether the given string contains prohibited combinations of dots.
   In the canonicalized form no path element may have dots at its end.
   Allowed canonical paths: c:\xa...dksd\..ksa\.lk    c:\...a\.b\cd..x.x
   Prohibited canonical paths: c:\..\x  c:\x.\d c:\...
*/
Tell whether the given string contains prohibited combinations of dots.
In the canonicalized form no path element may have dots at its end.
Tell whether the given string contains prohibited combinations of dots . In the canonicalized form no path element may have dots at its end .
static int
dots(char *start)
{
    char *p = start;
    while (*p) {
        if ((p = strchr(p, '.')) == NULL) 
            return 0; 
        p++; 
        while ((*p) == '.') 
            p++;
        if (*p && (*p != '\\')) 
            p++; 
        else
            return 1; 
    }
    return 0; 
}
static int dots ( char * start ) { char * p = start ; while ( * p ) { if ( ( p = strchr ( p , ' ' ) ) == NULL ) return 0 ; p ++ ; while ( ( * p ) == ' ' ) p ++ ; if ( * p && ( * p != ' \\ ' ) ) p ++ ; else return 1 ; } return 0 ; }
Tell whether the given string contains prohibited combinations of dots.
Tell whether the given string contains prohibited combinations of dots .
// find next occurrence of '.' // no more dots // next char // go to the end of dots // path element does not end with a dot // go to the next char // path element does end with a dot - prohibited // no prohibited combinations of dots found