OSDN Git Service

PATCH: [ 841897 ] Bail out of LoadFromFile if see embedded zeros
authorPerry Rapp <elsapo@users.sourceforge.net>
Sun, 16 Nov 2003 15:56:03 +0000 (15:56 +0000)
committerPerry Rapp <elsapo@users.sourceforge.net>
Sun, 16 Nov 2003 15:56:03 +0000 (15:56 +0000)
Src/MergeDoc.cpp
Src/readme.txt

index 2569c7d..5b4a153 100644 (file)
@@ -1180,6 +1180,13 @@ int CMergeDoc::CDiffTextBuffer::LoadFromFile(LPCTSTR pszFileNameInit, PackingInf
                do {
                        done = !pufile->ReadString(line, eol);
 
+
+                       if (pufile->GetTxtStats().nzeros)
+                       {
+                               nRetVal = FRESULT_BINARY;
+                               goto LoadFromFileExit;
+                       }
+
                        // if last line had no eol, we can quit
                        if (done && preveol.IsEmpty())
                                break;
@@ -1269,6 +1276,7 @@ int CMergeDoc::CDiffTextBuffer::LoadFromFile(LPCTSTR pszFileNameInit, PackingInf
                        readOnly = TRUE;
        }
        
+LoadFromFileExit:
 
        // delete the file that unpacking may have created
        if (_tcscmp(pszFileNameInit, pszFileName) != 0)
index f050dfb..5856de0 100644 (file)
@@ -1,3 +1,7 @@
+2003-11-16 Perry
+ PATCH: [ 841897 ] Bail out of LoadFromFile if see embedded zeros
+  WinMerge: MergeDoc.cpp
+
 2003-11-16 Kimmo
  BUG: [ 818416 ] is stat population missing from RunFileDiff ?
   WinMerge: DiffWrapper.cpp