From 6fca938971fcf80fbdd278fb8fbaf4b0e8476090 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 27 Feb 2008 06:17:10 +0000 Subject: Add path separator support, patch by Sam Bishop. llvm-svn: 47662 --- llvm/lib/System/Unix/Path.inc | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'llvm/lib/System/Unix/Path.inc') diff --git a/llvm/lib/System/Unix/Path.inc b/llvm/lib/System/Unix/Path.inc index 2dde37cdaee..c8bdd088c32 100644 --- a/llvm/lib/System/Unix/Path.inc +++ b/llvm/lib/System/Unix/Path.inc @@ -63,6 +63,8 @@ inline bool lastIsSlash(const std::string& path) { namespace llvm { using namespace sys; +extern const char sys::PathSeparator = ':'; + bool Path::isValid() const { // Check some obvious things @@ -183,25 +185,6 @@ Path::GetTemporaryDirectory(std::string* ErrMsg ) { #endif } -static void getPathList(const char*path, std::vector& Paths) { - const char* at = path; - const char* delim = strchr(at, ':'); - Path tmpPath; - while( delim != 0 ) { - std::string tmp(at, size_t(delim-at)); - if (tmpPath.set(tmp)) - if (tmpPath.canRead()) - Paths.push_back(tmpPath); - at = delim + 1; - delim = strchr(at, ':'); - } - if (*at != 0) - if (tmpPath.set(std::string(at))) - if (tmpPath.canRead()) - Paths.push_back(tmpPath); - -} - void Path::GetSystemLibraryPaths(std::vector& Paths) { #ifdef LTDL_SHLIBPATH_VAR -- cgit v1.2.3