Check if all existing path components are directories and not links.
| 95 | |
| 96 | // Check if all existing path components are directories and not links. |
| 97 | static bool LinkInPath(const wchar *Name) |
| 98 | { |
| 99 | wchar Path[NM]; |
| 100 | if (wcslen(Name)>=ASIZE(Path)) |
| 101 | return true; // It should not be that long, skip. |
| 102 | wcsncpyz(Path,Name,ASIZE(Path)); |
| 103 | for (wchar *s=Path+wcslen(Path)-1;s>Path;s--) |
| 104 | if (IsPathDiv(*s)) |
| 105 | { |
| 106 | *s=0; |
| 107 | FindData FD; |
| 108 | if (FindFile::FastFind(Path,&FD,true) && (FD.IsLink || !FD.IsDir)) |
| 109 | return true; |
| 110 | } |
| 111 | return false; |
| 112 | } |
| 113 | |
| 114 | |
| 115 | bool IsRelativeSymlinkSafe(CommandData *Cmd,const wchar *SrcName,const wchar *PrepSrcName,const wchar *TargetName) |
no test coverage detected