mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-11 00:36:20 +02:00
ZipInputAccessor: Fix root directory handling
This commit is contained in:
parent
1d36d16086
commit
08fc769d2c
1 changed files with 8 additions and 2 deletions
|
@ -81,13 +81,18 @@ struct ZipInputAccessor : InputAccessor
|
||||||
bool pathExists(PathView _path) override
|
bool pathExists(PathView _path) override
|
||||||
{
|
{
|
||||||
auto path = canonPath(_path);
|
auto path = canonPath(_path);
|
||||||
return members.find(((std::string) path).c_str()) != members.end();
|
return
|
||||||
|
members.find(((std::string) path).c_str()) != members.end()
|
||||||
|
|| members.find(((std::string) path + "/").c_str()) != members.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
Stat lstat(PathView _path) override
|
Stat lstat(PathView _path) override
|
||||||
{
|
{
|
||||||
auto path = canonPath(_path);
|
auto path = canonPath(_path);
|
||||||
|
|
||||||
|
if (path == "/")
|
||||||
|
return Stat { .type = tDirectory };
|
||||||
|
|
||||||
Type type = tRegular;
|
Type type = tRegular;
|
||||||
bool isExecutable = false;
|
bool isExecutable = false;
|
||||||
|
|
||||||
|
@ -126,7 +131,8 @@ struct ZipInputAccessor : InputAccessor
|
||||||
|
|
||||||
DirEntries readDirectory(PathView _path) override
|
DirEntries readDirectory(PathView _path) override
|
||||||
{
|
{
|
||||||
auto path = canonPath(_path) + "/";
|
auto path = canonPath(_path);
|
||||||
|
if (path != "/") path += "/";
|
||||||
|
|
||||||
auto i = members.find(((std::string) path).c_str());
|
auto i = members.find(((std::string) path).c_str());
|
||||||
if (i == members.end())
|
if (i == members.end())
|
||||||
|
|
Loading…
Reference in a new issue