| 584 | |
| 585 | |
| 586 | void GetPathRoot(const wchar *Path,wchar *Root,size_t MaxSize) |
| 587 | { |
| 588 | *Root=0; |
| 589 | if (IsDriveLetter(Path)) |
| 590 | swprintf(Root,MaxSize,L"%c:\\",*Path); |
| 591 | else |
| 592 | if (Path[0]=='\\' && Path[1]=='\\') |
| 593 | { |
| 594 | const wchar *Slash=wcschr(Path+2,'\\'); |
| 595 | if (Slash!=NULL) |
| 596 | { |
| 597 | size_t Length; |
| 598 | if ((Slash=wcschr(Slash+1,'\\'))!=NULL) |
| 599 | Length=Slash-Path+1; |
| 600 | else |
| 601 | Length=wcslen(Path); |
| 602 | if (Length>=MaxSize) |
| 603 | Length=0; |
| 604 | wcsncpy(Root,Path,Length); |
| 605 | Root[Length]=0; |
| 606 | } |
| 607 | } |
| 608 | } |
| 609 | |
| 610 | |
| 611 | int ParseVersionFileName(wchar *Name,bool Truncate) |
no test coverage detected