|
@@ -861,12 +861,12 @@ scan_directory(vector_string &contents, const string &subfile_name) const {
|
|
|
if (!(subfile->_name.length() > prefix.length() &&
|
|
if (!(subfile->_name.length() > prefix.length() &&
|
|
|
subfile->_name.substr(0, prefix.length()) == prefix)) {
|
|
subfile->_name.substr(0, prefix.length()) == prefix)) {
|
|
|
// We've reached the end of the list of subfiles beneath the
|
|
// We've reached the end of the list of subfiles beneath the
|
|
|
- // indicated direcotry prefix.
|
|
|
|
|
|
|
+ // indicated directory prefix.
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
size_t slash = subfile->_name.find('/', prefix.length());
|
|
size_t slash = subfile->_name.find('/', prefix.length());
|
|
|
- string basename = subfile->_name.substr(prefix.length(), slash);
|
|
|
|
|
|
|
+ string basename = subfile->_name.substr(prefix.length(), slash - prefix.length());
|
|
|
if (basename != previous) {
|
|
if (basename != previous) {
|
|
|
contents.push_back(basename);
|
|
contents.push_back(basename);
|
|
|
previous = basename;
|
|
previous = basename;
|