from 1.18 branch: Adjust things for using the new Firefox plugin: remove visible Beagle references + fix 1.18 web queue indexing bugs
This commit is contained in:
@@ -360,6 +360,26 @@ extern string path_canon(const string &is)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool makepath(const string& ipath)
|
||||
{
|
||||
string path = path_canon(ipath);
|
||||
vector<string> elems;
|
||||
stringToTokens(path, elems, "/");
|
||||
path = "/";
|
||||
for (vector<string>::const_iterator it = elems.begin();
|
||||
it != elems.end(); it++){
|
||||
path += *it;
|
||||
// Not using path_isdir() here, because this cant grok symlinks
|
||||
// If we hit an existing file, no worry, mkdir will just fail.
|
||||
if (access(path.c_str(), 0) != 0) {
|
||||
if (mkdir(path.c_str(), 0700) != 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
path += "/";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
vector<string> path_dirglob(const string &dir, const string pattern)
|
||||
{
|
||||
@@ -502,6 +522,10 @@ string fileurltolocalpath(string url)
|
||||
}
|
||||
return url;
|
||||
}
|
||||
bool urlisfileurl(const string& url)
|
||||
{
|
||||
return url.find("file://") == 0;
|
||||
}
|
||||
|
||||
// Printable url: this is used to transcode from the system charset
|
||||
// into either utf-8 if transcoding succeeds, or url-encoded
|
||||
|
||||
Reference in New Issue
Block a user