also fix M504
authorJim Morris <morris@wolfman.com>
Fri, 30 Jan 2015 23:08:31 +0000 (15:08 -0800)
committerJim Morris <morris@wolfman.com>
Fri, 30 Jan 2015 23:08:31 +0000 (15:08 -0800)
src/modules/utils/simpleshell/SimpleShell.cpp

index a6a4b9c..7e56e4f 100644 (file)
@@ -445,7 +445,13 @@ void SimpleShell::save_command( string parameters, StreamOutput *stream )
         filename = THEKERNEL->config_override_filename();
     }
 
-    remove(filename.c_str());
+    //remove(filename.c_str()); // seems to cause a hang every now and then
+    {
+        FileStream fs(filename.c_str());
+        fs.printf("; DO NOT EDIT THIS FILE\n");
+        // this also will truncate the existing file instead of deleting it
+    }
+
     // replace stream with one that writes to config-override file
     AppendFileStream *gs = new AppendFileStream(filename.c_str());
     // if(!gs->is_open()) {