From 7ea6ecf855dee69a1cd938c3fe7e4e132be00b24 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 25 Mar 2015 17:06:12 +0100 Subject: addToStore(): Take explicit name argument --- src/nix-store/nix-store.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nix-store') diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index 7baaa80ef306..60080f253a22 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -163,8 +163,8 @@ static void opAdd(Strings opFlags, Strings opArgs) { if (!opFlags.empty()) throw UsageError("unknown flag"); - for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); ++i) - cout << format("%1%\n") % store->addToStore(*i); + for (auto & i : opArgs) + cout << format("%1%\n") % store->addToStore(baseNameOf(i), i); } @@ -185,8 +185,8 @@ static void opAddFixed(Strings opFlags, Strings opArgs) HashType hashAlgo = parseHashType(opArgs.front()); opArgs.pop_front(); - for (Strings::iterator i = opArgs.begin(); i != opArgs.end(); ++i) - cout << format("%1%\n") % store->addToStore(*i, recursive, hashAlgo); + for (auto & i : opArgs) + cout << format("%1%\n") % store->addToStore(baseNameOf(i), i, recursive, hashAlgo); } -- cgit 1.4.1