+//
+// Restore the master document back to its pre-run state
+//
+void HandleFailure(void)
+{
+ // Close open files...
+ fclose(master);
+ fclose(exp);
+
+ if (newFile)
+ fclose(newFile);
+
+ // Remove our work, and restore the backup of the master document
+ remove("master-doc.txt");
+ rename("master-doc.bak", "master-doc.txt");
+}
+
+