* Better error message when nix-store --import is applied to garbage

(previously it would likely say "implementation cannot deal with >
  32-bit integers").
This commit is contained in:
Eelco Dolstra 2009-03-22 17:51:45 +00:00
parent 77d272623f
commit 7a57b2920b

View file

@ -625,7 +625,7 @@ static void opImport(Strings opFlags, Strings opArgs)
FdSource source(STDIN_FILENO); FdSource source(STDIN_FILENO);
while (true) { while (true) {
int n = readInt(source); unsigned long long n = readLongLong(source);
if (n == 0) break; if (n == 0) break;
if (n != 1) throw Error("input doesn't look like something created by `nix-store --export'"); if (n != 1) throw Error("input doesn't look like something created by `nix-store --export'");
cout << format("%1%\n") % store->importPath(requireSignature, source) << std::flush; cout << format("%1%\n") % store->importPath(requireSignature, source) << std::flush;