MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / GetExecutableFilename

Method GetExecutableFilename

src/core/unixfsservices.cpp:727–758  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

725
726
727bool cUnixFSServices::GetExecutableFilename(TSTRING& strFullPath, const TSTRING& strFilename) const
728{
729 bool fGotName = false;
730
731 if (strFilename.empty())
732 return false;
733
734 // if there is a slash in the filename, it's absolute or relative to cwd
735 if (TSTRING::npos != strFilename.find(_T('/')))
736 {
737 // if absolute path
738 if (strFilename[0] == _T('/'))
739 {
740 strFullPath = strFilename;
741 fGotName = true;
742 }
743 else // is relative path; find path from cwd
744 {
745 fGotName = FullPath(strFullPath, strFilename);
746 }
747 }
748 else // it's just a filename: should be found in path
749 {
750 fGotName = util_PathFind(strFullPath, strFilename);
751
752 TSTRING strFP;
753 if (fGotName && FullPath(strFP, strFullPath))
754 strFullPath = strFP;
755 }
756
757 return (fGotName);
758}
759
760
761///////////////////////////////////////////////////////////////////////////////

Callers 2

SetExeDirFunction · 0.80

Calls 3

util_PathFindFunction · 0.85
emptyMethod · 0.80
findMethod · 0.45

Tested by 1