|
a/src/utils/pathut.cpp |
|
b/src/utils/pathut.cpp |
1 |
#ifndef lint
|
1 |
#ifndef lint
|
2 |
static char rcsid[] = "@(#$Id: pathut.cpp,v 1.10 2006-03-29 11:18:15 dockes Exp $ (C) 2004 J.F.Dockes";
|
2 |
static char rcsid[] = "@(#$Id: pathut.cpp,v 1.11 2006-10-23 15:00:31 dockes Exp $ (C) 2004 J.F.Dockes";
|
3 |
#endif
|
3 |
#endif
|
4 |
/*
|
4 |
/*
|
5 |
* This program is free software; you can redistribute it and/or modify
|
5 |
* This program is free software; you can redistribute it and/or modify
|
6 |
* it under the terms of the GNU General Public License as published by
|
6 |
* it under the terms of the GNU General Public License as published by
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
7 |
* the Free Software Foundation; either version 2 of the License, or
|
|
... |
|
... |
185 |
for (int i = 0; i < int(mglob.gl_pathc); i++) {
|
185 |
for (int i = 0; i < int(mglob.gl_pathc); i++) {
|
186 |
res.push_back(mglob.gl_pathv[i]);
|
186 |
res.push_back(mglob.gl_pathv[i]);
|
187 |
}
|
187 |
}
|
188 |
globfree(&mglob);
|
188 |
globfree(&mglob);
|
189 |
return res;
|
189 |
return res;
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
bool path_isdir(const string& path)
|
|
|
193 |
{
|
|
|
194 |
struct stat st;
|
|
|
195 |
if (lstat(path.c_str(), &st) < 0)
|
|
|
196 |
return false;
|
|
|
197 |
if (S_ISDIR(st.st_mode))
|
|
|
198 |
return true;
|
|
|
199 |
return false;
|
190 |
}
|
200 |
}
|
191 |
|
201 |
|
192 |
std::string url_encode(const std::string url, string::size_type offs)
|
202 |
std::string url_encode(const std::string url, string::size_type offs)
|
193 |
{
|
203 |
{
|
194 |
string out = url.substr(0, offs);
|
204 |
string out = url.substr(0, offs);
|