about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-06 11:33:29 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-06 11:33:29 -0700
commitcc3b58b6370f27fb3fb600d6538a542c2fe44d36 (patch)
tree27cb6a5df5c0524d69fe49dfa28ea39756d31e0a
parent4b1b0222ebbdcd86bddf82392c7908ea78a8e921 (diff)
downloadmu-cc3b58b6370f27fb3fb600d6538a542c2fe44d36.tar.gz
1023
-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();
 }