mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Resolve path when Bundles folder is a link
This would cause a crash if the Bundles folder was a symbolic link (e.g. to DropBox) since we assumed the entry itself had entries (but only directory nodes have entries). This closes issue #321.
This commit is contained in:
@@ -531,7 +531,7 @@ namespace bundles
|
||||
bool local = true;
|
||||
iterate(path, locations())
|
||||
{
|
||||
std::string const cwd = path::join(*path, "Bundles");
|
||||
std::string cwd = path::join(*path, "Bundles");
|
||||
std::map<std::string, fs::node_t>::const_iterator node = heads.find(cwd);
|
||||
if(node == heads.end() || node->second.type() == fs::node_t::kNodeTypeMissing)
|
||||
{
|
||||
@@ -539,7 +539,14 @@ namespace bundles
|
||||
continue;
|
||||
}
|
||||
|
||||
citerate(fsBundle, *node->second.entries())
|
||||
fs::node_t bundlesNode = resolve(cwd, node->second, heads);
|
||||
if(bundlesNode.type() != fs::node_t::kNodeTypeDirectory || !bundlesNode.entries())
|
||||
{
|
||||
fprintf(stderr, "*** no bundles for path ‘%s’\n", bundlesNode.real_path(cwd).c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
citerate(fsBundle, *bundlesNode.entries())
|
||||
{
|
||||
if(text::lowercase(path::extension(fsBundle->name())) != ".tmbundle")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user