check for initialization with an empty pattern (backport from old trunk)

This commit is contained in:
Marian Krivos 2012-08-07 20:56:38 +00:00
parent 9e27531c68
commit 2f0ab58544

View File

@ -46,9 +46,8 @@
namespace Poco {
Glob::Glob(const std::string& pattern, int options):
_pattern(pattern),
_options(options)
Glob::Glob(const std::string& pattern, int options)
: _pattern(pattern), _options(options)
{
poco_assert(!_pattern.empty());
}
@ -102,7 +101,8 @@ void Glob::glob(const Path& pathPattern, std::set<std::string>& files, int optio
base.popDirectory();
absBase.popDirectory();
}
if (pathPattern.isDirectory()) options |= GLOB_DIRS_ONLY;
if (pathPattern.isDirectory())
options |= GLOB_DIRS_ONLY;
collect(pattern, absBase, base, pathPattern[base.depth()], files, options);
}