Lines Matching defs:path
831 char *path;
834 path = static_cast<char *>(malloc(len + 1));
835 if (path == nullptr) {
838 memcpy(path, argv0, len + 1);
841 path = static_cast<char *>(malloc(len + 1 + cwdlen + 1));
842 if (path == nullptr) {
845 memcpy(path, cwd, cwdlen);
846 path[cwdlen] = '/';
847 memcpy(path + cwdlen + 1, argv0, len + 1);
850 return path;
853 bool check_path(const std::string &path) {
854 // We don't like '\' in path.
855 return !path.empty() && path[0] == '/' &&
856 path.find('\\') == std::string::npos &&
857 path.find("/../") == std::string::npos &&
858 path.find("/./") == std::string::npos &&
859 !util::ends_with_l(path, "/..") && !util::ends_with_l(path, "/.");