Skip to content

Commit

Permalink
Fix narSize usage in Perl bindings too
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Sep 24, 2020
1 parent bf27d32 commit 04ecf5c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions perl/lib/Nix/Store.xs
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,17 @@ SV * queryPathInfo(char * path, int base32)
XPUSHs(&PL_sv_undef);
else
XPUSHs(sv_2mortal(newSVpv(store()->printStorePath(*info->deriver).c_str(), 0)));
if (auto optHash = info->optNarHash()) {
auto s = optHash->to_string(base32 ? Base32 : Base16, true);
if (auto optHashSize = *info->viewHashResultConst()) {
auto [narHash, narSize] = *optHashSize;
auto s = narHash.to_string(base32 ? Base32 : Base16, true);
XPUSHs(sv_2mortal(newSVpv(s.c_str(), 0)));
mXPUSHi(info->registrationTime);
mXPUSHi(narSize);
} else {
XPUSHs((SV *) NULL);
mXPUSHi(info->registrationTime);
mXPUSHi(0);
}
mXPUSHi(info->registrationTime);
mXPUSHi(info->narSize);
AV * arr = newAV();
for (auto & i : info->references)
av_push(arr, newSVpv(store()->printStorePath(i).c_str(), 0));
Expand Down

0 comments on commit 04ecf5c

Please sign in to comment.