diff options
-rw-r--r-- | 102persist.cc | 1 | ||||
-rw-r--r-- | html/102persist.cc.html | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/102persist.cc b/102persist.cc index abefeda6..642385df 100644 --- a/102persist.cc +++ b/102persist.cc @@ -98,6 +98,7 @@ case SAVE: { filename = read_mu_text(ingredients.at(0).at(0)); } ofstream fout(("lesson/"+filename).c_str()); + if (!fout) break; string contents = read_mu_text(ingredients.at(1).at(0)); fout << contents; fout.close(); diff --git a/html/102persist.cc.html b/html/102persist.cc.html index 55961625..863546d2 100644 --- a/html/102persist.cc.html +++ b/html/102persist.cc.html @@ -130,6 +130,7 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span filename = read_mu_text<span class="Delimiter">(</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> <span class="Delimiter">}</span> ofstream fout<span class="Delimiter">((</span><span class="Constant">"lesson/"</span>+filename<span class="Delimiter">).</span>c_str<span class="Delimiter">());</span> + <span class="Normal">if</span> <span class="Delimiter">(</span>!fout<span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span> string contents = read_mu_text<span class="Delimiter">(</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">));</span> fout << contents<span class="Delimiter">;</span> fout<span class="Delimiter">.</span>close<span class="Delimiter">();</span> |