Calculate a number of path components except \. and \..
| 76 | |
| 77 | // Calculate a number of path components except \. and \.. |
| 78 | static int CalcAllowedDepth(const wchar *Name) |
| 79 | { |
| 80 | int AllowedDepth=0; |
| 81 | while (*Name!=0) |
| 82 | { |
| 83 | if (IsPathDiv(Name[0]) && Name[1]!=0 && !IsPathDiv(Name[1])) |
| 84 | { |
| 85 | bool Dot=Name[1]=='.' && (IsPathDiv(Name[2]) || Name[2]==0); |
| 86 | bool Dot2=Name[1]=='.' && Name[2]=='.' && (IsPathDiv(Name[3]) || Name[3]==0); |
| 87 | if (!Dot && !Dot2) |
| 88 | AllowedDepth++; |
| 89 | } |
| 90 | Name++; |
| 91 | } |
| 92 | return AllowedDepth; |
| 93 | } |
| 94 | |
| 95 | |
| 96 | // Check if all existing path components are directories and not links. |
no test coverage detected