deps/unrar/extinfo.cpp
// Calculate a number of path components except \. and \..
Calculate a number of path components except \. and \
Calculate a number of path components except \ . and \
static int CalcAllowedDepth(const wchar *Name)
{
  int AllowedDepth=0;
  while (*Name!=0)
  {
    if (IsPathDiv(Name[0]) && Name[1]!=0 && !IsPathDiv(Name[1]))
    {
      bool Dot=Name[1]=='.' && (IsPathDiv(Name[2]) || Name[2]==0);
      bool Dot2=Name[1]=='.' && Name[2]=='.' && (IsPathDiv(Name[3]) || Name[3]==0);
      if (!Dot && !Dot2)
        AllowedDepth++;
    }
    Name++;
  }
  return AllowedDepth;
}
static int CalcAllowedDepth ( const wchar * Name ) { int AllowedDepth = 0 ; while ( * Name != 0 ) { if ( IsPathDiv ( Name [ 0 ] ) && Name [ 1 ] != 0 && ! IsPathDiv ( Name [ 1 ] ) ) { bool Dot = Name [ 1 ] == ' ' && ( IsPathDiv ( Name [ 2 ] ) || Name [ 2 ] == 0 ) ; bool Dot2 = Name [ 1 ] == ' ' && Name [ 2 ] == ' ' && ( IsPathDiv ( Name [ 3 ] ) || Name [ 3 ] == 0 ) ; if ( ! Dot && ! Dot2 ) AllowedDepth ++ ; } Name ++ ; } return AllowedDepth ; }
Calculate a number of path components except \.
Calculate a number of path components except \ .