From 7fdf0665dff2a8e019ccaf13a83ac1fa1e441fc9 Mon Sep 17 00:00:00 2001
From: "Silas S. Brown" <ssb22@cam.ac.uk>
Date: Fri, 5 Oct 2012 16:55:37 +0000
Subject: [PATCH] Gradint update

git-svn-id: http://svn.code.sf.net/p/e-guidedog/code/ssb22/gradint@1455 29193198-4895-4776-b068-10539e920549
---
 gradint-build/src/frontend.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gradint-build/src/frontend.py b/gradint-build/src/frontend.py
index d4cafcc..d414de8 100644
--- a/gradint-build/src/frontend.py
+++ b/gradint-build/src/frontend.py
@@ -1673,7 +1673,7 @@ def gui_event_loop():
                 o.write(text1+"="+text2+"\n") # was " = " but it slows down parseSynthVocab
                 o.close()
                 if paranoid_file_management:
-                    if filelen(vocabFile)<filelen(vocabFile+"~"): app.todo.alert="Vocab file corruption! You'd better restore the ~ backup."
+                    if filelen(vocabFile)<filelen(vocabFile+"~") or chr(0) in open(vocabFile).read(1024): app.todo.alert="Vocab file corruption! You'd better restore the ~ backup."
                 if hasattr(app,"vocabList"): app.vocabList.append((ensure_unicode(text1),ensure_unicode(text2)))
                 app.todo.clear_text_boxes=app.wordsExist=1
         elif menu_response=="delete" or menu_response=="replace":
-- 
GitLab