Made get_editor_string use contents and mtime to check for changes
authorAaron Bentley <abentley@panoramicfeedback.com>
Thu, 24 Mar 2005 16:40:49 +0000 (16:40 +0000)
committerAaron Bentley <abentley@panoramicfeedback.com>
Thu, 24 Mar 2005 16:40:49 +0000 (16:40 +0000)
libbe/utility.py

index de5d2c58ee30d6f6a598972ca9b06c9a8a1cdfef..a39253831e4a55ebb47d81fc7158e1a5e5917dbd 100644 (file)
@@ -91,7 +91,8 @@ def editor_string():
         os.close(fhandle)
         oldmtime = os.path.getmtime(fname)
         os.system("%s %s" % (editor, fname))
-        if oldmtime == os.path.getmtime(fname):
+        if oldmtime == os.path.getmtime(fname) and\
+            file(fname, "rb").read() == "":
             output = None
         else:
             output = file(fname, "rb").read()