gcc 4.5 compatibility
This commit is contained in:
parent
95ccd9483b
commit
e9fefcac46
|
@ -77,7 +77,7 @@ static void AddInclPathsToList(const std::string& FileList, std::list<std::strin
|
||||||
PathName = Path::fromNativeSeparators(PathName);
|
PathName = Path::fromNativeSeparators(PathName);
|
||||||
|
|
||||||
// If path doesn't end with / or \, add it
|
// If path doesn't end with / or \, add it
|
||||||
if (PathName.back() != '/')
|
if (!endsWith(PathName, '/'))
|
||||||
PathName += '/';
|
PathName += '/';
|
||||||
|
|
||||||
PathNames->push_back(PathName);
|
PathNames->push_back(PathName);
|
||||||
|
@ -426,7 +426,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
|
||||||
path = Path::fromNativeSeparators(path);
|
path = Path::fromNativeSeparators(path);
|
||||||
|
|
||||||
// If path doesn't end with / or \, add it
|
// If path doesn't end with / or \, add it
|
||||||
if (path.back() != '/')
|
if (!endsWith(path,'/'))
|
||||||
path += '/';
|
path += '/';
|
||||||
|
|
||||||
_settings->includePaths.push_back(path);
|
_settings->includePaths.push_back(path);
|
||||||
|
@ -480,7 +480,7 @@ bool CmdLineParser::ParseFromArgs(int argc, const char* const argv[])
|
||||||
|
|
||||||
if (FileLister::isDirectory(path)) {
|
if (FileLister::isDirectory(path)) {
|
||||||
// If directory name doesn't end with / or \, add it
|
// If directory name doesn't end with / or \, add it
|
||||||
if (path.back() != '/')
|
if (!endsWith(path, '/'))
|
||||||
path += '/';
|
path += '/';
|
||||||
}
|
}
|
||||||
_ignoredPaths.push_back(path);
|
_ignoredPaths.push_back(path);
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
#include "pathmatch.h"
|
#include "pathmatch.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
@ -228,7 +229,7 @@ void FileLister::addFiles(std::map<std::string, std::size_t> &files, const std::
|
||||||
{
|
{
|
||||||
if (!path.empty()) {
|
if (!path.empty()) {
|
||||||
std::string corrected_path = path;
|
std::string corrected_path = path;
|
||||||
if (corrected_path.back() == '/')
|
if (endsWith(corrected_path, '/'))
|
||||||
corrected_path.erase(corrected_path.end() - 1);
|
corrected_path.erase(corrected_path.end() - 1);
|
||||||
|
|
||||||
addFiles2(files, corrected_path, extra, recursive, ignored);
|
addFiles2(files, corrected_path, extra, recursive, ignored);
|
||||||
|
|
Loading…
Reference in New Issue