src/strip.vala
[app.mailtrimmer] / src / strip.vala
index afd139c..23d4174 100644 (file)
@@ -556,6 +556,9 @@ public class Strip : GLib.Object {
                        "/"+ this.active_name + "."+   GLib.Uri.escape_string(filename,"", false);
 
            var outfile = new GMime.StreamFile.for_path(fn, "w");
+           if (outfile == null) {
+               return; // something has gone wrong??
+       }
            outfile.set_owner(true);
            var file_size = (int) c.write_to_stream(outfile);
            var chksum = this.md5_file(fn);
@@ -1068,7 +1071,7 @@ public class Strip : GLib.Object {
                
         }
         
-       if (GLib.FileUtils.test( basepath + subpath + ".strip-done-stamp", GLib.FileTest.EXISTS )) {
+       if (StripApplication.opt_stamp && GLib.FileUtils.test( basepath + subpath + "/.strip-done-stamp", GLib.FileTest.EXISTS )) {
                return;
                }
         
@@ -1156,8 +1159,8 @@ public class Strip : GLib.Object {
         
         // completed this folder
         
-        if (opt_stamp) {
-               GLib.FileUtils.set_contents (basepath + subpath + ".strip-done-stamp", "Stripper done");
+        if (StripApplication.opt_stamp) {
+               GLib.FileUtils.set_contents (basepath + subpath + "/.strip-done-stamp", "Stripper done");
         }