about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--cpp/011load4
-rw-r--r--cpp/013run2
2 files changed, 5 insertions, 1 deletions
diff --git a/cpp/011load b/cpp/011load
index cffcc551..eb8ed8f1 100644
--- a/cpp/011load
+++ b/cpp/011load
@@ -12,6 +12,10 @@ recipe main [
 vector<recipe_number> add_recipes(string form) {
   istringstream in(form);
   in >> std::noskipws;
+  return add_recipes(in);
+}
+
+vector<recipe_number> add_recipes(istream& in) {
   vector<recipe_number> result;
   while (!in.eof()) {
     skip_comments_and_newlines(in);
diff --git a/cpp/013run b/cpp/013run
index e5da06f3..6888d8f5 100644
--- a/cpp/013run
+++ b/cpp/013run
@@ -99,7 +99,7 @@ if (argc > 1) {
 :(code)
 void load(string filename) {
   ifstream fin(filename.c_str());
-  while (!fin.eof()) add_recipe(fin);
+  add_recipes(fin);
   fin.close();
 }