about summary refs log tree commit diff stats
path: root/082persist.cc
diff options
context:
space:
mode:
Diffstat (limited to '082persist.cc')
-rw-r--r--082persist.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/082persist.cc b/082persist.cc
index d663773c..d63176bd 100644
--- a/082persist.cc
+++ b/082persist.cc
@@ -8,13 +8,15 @@ RESTORE,
 Recipe_ordinal["restore"] = RESTORE;
 :(before "End Primitive Recipe Implementations")
 case RESTORE: {
+  products.resize(1);
   if (SIZE(ingredients) != 1) {
     raise << current_recipe_name() << ": 'restore' requires exactly one ingredient, but got " << current_instruction().to_string() << '\n' << end();
     break;
   }
-  if (!scalar(ingredients.at(0)))
+  if (!scalar(ingredients.at(0))) {
     raise << current_recipe_name() << ": first ingredient of 'restore' should be a literal string, but got " << current_instruction().ingredients.at(0).to_string() << '\n' << end();
-  products.resize(1);
+    break;
+  }
   if (Current_scenario) break;  // do nothing in tests
   string filename = current_instruction().ingredients.at(0).name;
   if (!is_literal(current_instruction().ingredients.at(0)))