From 1c6bea3220767f3116db9fb0038fe4d5a87f3b5e Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Mon, 9 Apr 2007 05:59:46 +0000 Subject: [PATCH] No longer try to automatically backup binary files (especially nasty when loading subs from mkv). Originally committed to SVN as r1047. --- aegisub/frame_main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aegisub/frame_main.cpp b/aegisub/frame_main.cpp index d60f6ddc9..ad7691085 100644 --- a/aegisub/frame_main.cpp +++ b/aegisub/frame_main.cpp @@ -546,6 +546,7 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) { // Setup bool isFile = (filename != _T("")); + bool isBinary = false; // Load try { @@ -556,6 +557,7 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) { // Make sure that file isn't actually a timecode file TextFileReader testSubs(filename); + isBinary = testSubs.GetCurrentEncoding() == _T("binary"); if (testSubs.HasMoreLines()) { wxString cur = testSubs.ReadLineFromFile(); if (cur.Left(10) == _T("# timecode")) { @@ -587,7 +589,7 @@ void FrameMain::LoadSubtitles (wxString filename,wxString charset) { // Save copy wxFileName origfile(filename); - if (Options.AsBool(_T("Auto backup")) && origfile.FileExists()) { + if (!isBinary && Options.AsBool(_T("Auto backup")) && origfile.FileExists()) { // Get path wxString path = Options.AsText(_T("Auto backup path")); if (path.IsEmpty()) path = origfile.GetPath();