OSDN Git Service
GreyMerlin [Mon, 13 Mar 2017 21:00:04 +0000 (14:00 -0700)]
Properly handle 3-way comparison of Binary files.
Symptom: Binary files always mis-compare with 3-way comparison,
although the same files compare correctly with 2-way compares.
Background: 3-way comparison of files F0, F1 and F2 is handled by two
2-way comparisons of F1/F0 and F1/F2. However, the two 2-way
comparisons for binary are slightly different from the standard
2-way text comparison.
Root Problems:
* See procedure read_files() in Src/diffutils/src/io.c
This area of code was allowing binary files to be treated as text,
looking for endline situations and modifying the contents of the
first filevec[i].buffer[] array by placing sentinel markers into
that buffer. But this was only done for one file, F1 in the example
above. The contents of F0 and F2 were not being modified. This
caused the memcmp() in diff_2_files() in Src/diffutils/src/analyze.c
to detect a mis-miscompare.
* See procedure diff_2_files() in Src/diffutils/src/analyze.c
A binary comparison is flagged by read_files(). Because read_files
is only checking one file (e.g. F1), the buffer size for the other
file (e.g. F0 or F2) is never changed to be identical to the size
for F1. This makes it impossible for the comparison loop to stay
in sync between the two files.
Solution:
* Within read_files(), after appears_binary flag has been set, there
is new logic that allocates buffers for each file, based on the
size of existing buffers, the file size, and a reasonable maximum
threshold. Binary file processing ends with a flag being returned
to the caller. [It is within find_identical_ends() that buffers
are allocated for text files and the search for text-line boundaries
occurs, and was incorrectly used for binary files.]
* Within diff_2_files() is the code that performs the 2-way binary
comparison, after read_files() has determined that at least one
file is binary. Tests are made to determine if inequality can be
known without reading the data. Buffers of the same size are read
from each file. The buffers are checked to determine if the buffer
contents are compatible and the data values of the two buffers are
equal. The outer-loop will repeat to read each subsequent block.
[Note: it is typical to enter this loop [the for (;;) statement]
with some data already read into filevec[0].buffer, but not a
complete buffer's amount; likewise filevec[1].buffer will typically
still be empty.]
Incidental changes...
* Trivial fix to a comment, discovered while reading code in
Src/DiffWrapper.cpp.
* Trivial column alignment issue in analyze.c
* Better checking for non-existent files with more use of S_ISREG()
define (internally, non-existent files are handled with an open
descriptor on the NUL: device). This allow small optimization of
buffer allocation.
* Assert that files opened as S_ISCHR() really are the NUL: file
Takashi Sawanaka [Thu, 9 Mar 2017 15:32:45 +0000 (00:32 +0900)]
Merge pull request #20 from GreyMerlin/feature/Readme
Readme.md - fix first line
Takashi Sawanaka [Thu, 9 Mar 2017 15:28:44 +0000 (00:28 +0900)]
Merge pull request #19 from GreyMerlin/feature/VS2015
Feature/vs2015
GreyMerlin [Thu, 9 Mar 2017 03:21:05 +0000 (19:21 -0800)]
Readme.md - fix first line
* the first line of readme.md needs a space character between the end of the
first URL and the following parenthesis '('. Without the space the two
separate URLs are parsed by most browsers as one long (and useless)
URL.
GreyMerlin [Tue, 7 Mar 2017 23:10:00 +0000 (15:10 -0800)]
Convert to VS2015 - (Warnings)
* remove Warnings in Compile, Librarian and Linker options
* VS2015 warns about /EHsc and changes them to /EHa, so
I changed all compilations to /EHa i.e. ExceptionHandling=Async
to eliminate the warnings
* ImageHasSafeExceptionHandlers=true is incompatible with EditAndContinue, so
I changed Debug linking to be ImageHasSafeExceptionHandlers=false
* Make sure DebugInformationFormat=EditAndContinue for all _DEBUG compiles
and default otherwise
* Set Profile=false for X64 Debug; otherwise incremental linking is disabled.
Use of Profile should be individual and not released.
* Unittests is now configured to depend on poco
GreyMerlin [Tue, 7 Mar 2017 22:11:22 +0000 (14:11 -0800)]
Convert to VS2015 - (SubSystem)
* For all Linker and Librarian runs ...
make sure that SubSystem=Windows is set
make sure that TargetMachine is properly set
GreyMerlin [Tue, 7 Mar 2017 21:49:54 +0000 (13:49 -0800)]
Convert to VS2015 - (MultiProcessor Compilations)
* turn on MultiProcessorCompilation=true
* remove MinimalRebuild=true (i.e. defaults to false)
GreyMerlin [Tue, 7 Mar 2017 02:05:36 +0000 (18:05 -0800)]
Convert to VS2015 - (oops #2)
* the change in (simplify #2) that changes build directory names was a *very wrong* idea.
* this patch puts those names back as they always have been.
GreyMerlin [Mon, 6 Mar 2017 18:35:29 +0000 (10:35 -0800)]
Convert to VS2015 - (adapt to "Add batch files to WinMerge.sln")
* Recent [sdottaka/master update jp-130] contained an addition to WinMerge.sln
This is now propagated into WinMerge_vs2015.sln
GreyMerlin [Mon, 6 Mar 2017 18:33:04 +0000 (10:33 -0800)]
Convert to VS2015 - (oops #1)
* somehow a <PropertyGroup> tag became <DLLPropertyGroup>
GreyMerlin [Sun, 5 Mar 2017 01:29:25 +0000 (17:29 -0800)]
Convert to VS2015 - Step 6 (Simplify #2)
* simplify folder names to one level within Build/ and BuildTmp/
* remove libs for expat, scew, heksedit from linker step
* simplify specification of MergeLang output directories.
* greatly simplify "Post-Build Event" command line
GreyMerlin [Sat, 4 Mar 2017 22:42:43 +0000 (14:42 -0800)]
Convert to VS2015 - Step 5 (Simplify #1)
* Poco projects now only have UnicodeDebug and UnicodeRelease
configuration, these were all derived from 'static mt' configurations.
* the static, dynamic, shared configurations are gone
* identical style for Win32 and Win64
GreyMerlin [Sat, 4 Mar 2017 19:34:22 +0000 (11:34 -0800)]
Convert to VS2015 - Step 4 (Unicode)
* switch Mergelang and the 3 Poco projects from MultiByte to Unicode
GreyMerlin [Sat, 4 Mar 2017 19:19:04 +0000 (11:19 -0800)]
Convert to VS2015 - Step 3 (Win32)
* Convert all Win32 projects to V140 platform; similar to Step 2 for Win64
* MergeLang and UnitTests both run correctly (Release and Debug)
GreyMerlin [Sat, 4 Mar 2017 16:14:10 +0000 (08:14 -0800)]
Convert to VS2015 - Step 2 (Win64)
* solution is set for 14.0.25420.1
* all 6 projects now compile with new .sln and .vcxproj files for Win64
* all are set for Platform Tool Set V140 (not the v120_xp platform)
* all are set for Target Platform 10.0.14393.0 (not 8.1)
* Various testing of WinMerge (Release and Debug) show normal behavior
* both MergeLang and UnitTests run correctly
GreyMerlin [Sat, 4 Mar 2017 14:23:14 +0000 (06:23 -0800)]
Convert to VS2015 - Step 1
* this commit only copies existing .sln and .vcxproj files, with new names
* most recent *_vs100.vcxproj project files used, others were very old.
* all existing .sln and .vcxproj files remain unmodified
* (this lays groundwork for pending conversion to VS2017)
* only the 6 projects referenced from the .sln file were used
* ShellExtension ignored (for now)
* .SLN file is now WinMerge_vs2015.sln
* .VCXPROJ files are now *_vs2015.vcxproj
Takashi Sawanaka [Sun, 5 Mar 2017 07:49:46 +0000 (16:49 +0900)]
Add batch files to WinMerge.sln
Takashi Sawanaka [Sun, 5 Mar 2017 07:31:42 +0000 (16:31 +0900)]
Bump revision to 2.14.0+-jp-130
Takashi Sawanaka [Sun, 5 Mar 2017 06:50:38 +0000 (15:50 +0900)]
Folder Compare: Add 'Parent Folder' menu item in 'Open Left/Middle/Right' menu
Takashi Sawanaka [Sat, 4 Mar 2017 12:58:38 +0000 (21:58 +0900)]
Options dialog: Update color buttons when importing a .ini file
Takashi Sawanaka [Wed, 1 Mar 2017 13:38:57 +0000 (22:38 +0900)]
Added tag 2.14.0+-jp-129 for changeset
e09a4a185f03
Takashi Sawanaka [Sun, 26 Feb 2017 15:24:56 +0000 (00:24 +0900)]
Bump revision to 2.14.0+-jp-129
Takashi Sawanaka [Sun, 26 Feb 2017 15:20:42 +0000 (00:20 +0900)]
Add Dragging Mode menu item
Takashi Sawanaka [Sun, 26 Feb 2017 15:18:10 +0000 (00:18 +0900)]
ImgMergeFrm.cpp: Allow to scroll by PageUp/PageDown key
Takashi Sawanaka [Sun, 26 Feb 2017 00:15:54 +0000 (09:15 +0900)]
Improve support for high-contrast-mode
Takashi Sawanaka [Sat, 25 Feb 2017 23:34:39 +0000 (08:34 +0900)]
Add 'Margin' color button to 'Colors/Text' setting page.
Takashi Sawanaka [Sun, 5 Feb 2017 12:59:12 +0000 (21:59 +0900)]
Added tag 2.14.0+-jp-128 for changeset
1c8ea7d62dfe
Takashi Sawanaka [Sun, 5 Feb 2017 12:58:57 +0000 (21:58 +0900)]
Bump revision to 2.14.0+-jp-128
Takashi Sawanaka [Sun, 5 Feb 2017 12:58:39 +0000 (21:58 +0900)]
BuildArc.cmd: Upload files to VirusTotal.com
Takashi Sawanaka [Sun, 5 Feb 2017 11:08:45 +0000 (20:08 +0900)]
When comparing three folders Right EOL and Right Encoding column were empty
Takashi Sawanaka [Sun, 29 Jan 2017 03:13:55 +0000 (12:13 +0900)]
Added tag 2.14.0+-jp-127 for changeset
7a5160109fcd
Takashi Sawanaka [Sun, 29 Jan 2017 03:13:39 +0000 (12:13 +0900)]
Bump revision to 2.14.0+-jp-127
Takashi Sawanaka [Sun, 29 Jan 2017 02:12:15 +0000 (11:12 +0900)]
fix broken unit tests
Takashi Sawanaka [Sun, 29 Jan 2017 02:09:24 +0000 (11:09 +0900)]
unicoder.cpp: CheckForInvalidUtf8() did not work correctly when text length is less than 3. fixes bitbucket#57
Takashi Sawanaka [Mon, 9 Jan 2017 14:06:08 +0000 (23:06 +0900)]
Added tag 2.14.0+-jp-126 for changeset
7e8d73f57c1e
Takashi Sawanaka [Mon, 9 Jan 2017 14:05:39 +0000 (23:05 +0900)]
Bump revision to 2.14.0+-jp-126
Takashi Sawanaka [Mon, 9 Jan 2017 12:43:08 +0000 (21:43 +0900)]
Merge
Takashi Sawanaka [Mon, 9 Jan 2017 12:41:58 +0000 (21:41 +0900)]
Enabled to move to the next/previous file with the Up/Down key
Takashi Sawanaka [Mon, 9 Jan 2017 03:34:49 +0000 (12:34 +0900)]
MessageBoxDialog.{cpp,h}: Add GetFormerResult() method that retrieves the former result of the message box
Takashi Sawanaka [Sun, 8 Jan 2017 11:10:08 +0000 (20:10 +0900)]
Merge pull request #17 from Lippe35/master
Fix some translation (Portuguese.po) Part7
Lippe35 [Sun, 8 Jan 2017 08:56:12 +0000 (08:56 +0000)]
Fix some translation (Portuguese.po) Part7
Takashi Sawanaka [Sun, 8 Jan 2017 06:34:10 +0000 (15:34 +0900)]
DirScan.cpp: Fix assertion failure
Takashi Sawanaka [Thu, 5 Jan 2017 13:32:23 +0000 (22:32 +0900)]
Merge pull request #16 from Lippe35/master
Corrections and Add missing translation (Portuguese.po) Part7
Lippe35 [Thu, 5 Jan 2017 09:46:33 +0000 (09:46 +0000)]
Corrections and Add missing translation (Portuguese.po) Part7
Takashi Sawanaka [Tue, 3 Jan 2017 07:44:16 +0000 (16:44 +0900)]
PropCompareFolder.cpp: Disable the 'number of compare threads" text box when not selecting 'Full Content' and 'Quick Content' method
Takashi Sawanaka [Mon, 2 Jan 2017 12:04:34 +0000 (21:04 +0900)]
use namespace
Takashi Sawanaka [Mon, 2 Jan 2017 11:19:48 +0000 (20:19 +0900)]
Replace FileTransform_* with FileTransform::*
Takashi Sawanaka [Mon, 2 Jan 2017 10:54:25 +0000 (19:54 +0900)]
Replace string_* with strutils::*
Takashi Sawanaka [Mon, 2 Jan 2017 10:33:29 +0000 (19:33 +0900)]
Replace sd_* with strdiff::*
Takashi Sawanaka [Mon, 2 Jan 2017 09:31:32 +0000 (18:31 +0900)]
charset.c: map the encoding 'asmo-708' to codepage 708
Takashi Sawanaka [Mon, 2 Jan 2017 08:50:55 +0000 (17:50 +0900)]
Remove codepage.*
Takashi Sawanaka [Mon, 2 Jan 2017 06:23:11 +0000 (15:23 +0900)]
Remove dllproxy.*
Takashi Sawanaka [Sun, 1 Jan 2017 10:44:42 +0000 (19:44 +0900)]
Reduce warnings
Takashi Sawanaka [Thu, 29 Dec 2016 15:07:39 +0000 (00:07 +0900)]
Add git_clone.cmd and hg_clone.cmd
Takashi Sawanaka [Thu, 29 Dec 2016 12:51:59 +0000 (21:51 +0900)]
Reduce the height of Open dialog
Takashi Sawanaka [Thu, 29 Dec 2016 12:16:58 +0000 (21:16 +0900)]
Add 'Alpha Blend Animation" menu item
Takashi Sawanaka [Thu, 29 Dec 2016 08:45:39 +0000 (17:45 +0900)]
DirScan.cpp: When the number of CPU cores exceeds 16, comparison of folders did not proceed.
Takashi Sawanaka [Wed, 14 Dec 2016 16:18:35 +0000 (01:18 +0900)]
Added tag 2.14.0+-jp-125 for changeset
87a56f21d0bb
Takashi Sawanaka [Wed, 14 Dec 2016 16:18:21 +0000 (01:18 +0900)]
Bump revision to 2.14.0+-jp-125
Takashi Sawanaka [Wed, 14 Dec 2016 16:18:04 +0000 (01:18 +0900)]
Add 'Number of compare threads' textbox to Options dialog. (Merge from WinMerge2011)
Takashi Sawanaka [Mon, 12 Dec 2016 14:43:02 +0000 (23:43 +0900)]
Add Calvin Lin to Contributors.txt
Takashi Sawanaka [Fri, 9 Dec 2016 15:53:49 +0000 (00:53 +0900)]
Traditional Chinese translation update submitted by Calvin Lin
Takashi Sawanaka [Thu, 8 Dec 2016 14:07:50 +0000 (23:07 +0900)]
Merge pull request #15 from Lippe35/master
Add translation Portuguese.isl
Lippe35 [Wed, 7 Dec 2016 15:54:44 +0000 (15:54 +0000)]
Add translation Portuguese.isl
Takashi Sawanaka [Mon, 5 Dec 2016 14:16:55 +0000 (23:16 +0900)]
Merge pull request #14 from Lippe35/master
Add translation Portuguese.isl and Portuguese.po
Lippe35 [Sun, 4 Dec 2016 21:18:15 +0000 (21:18 +0000)]
Add translation Portuguese.isl and Portuguese.po
Takashi Sawanaka [Sun, 4 Dec 2016 13:40:20 +0000 (22:40 +0900)]
Added tag 2.14.0+-jp-124 for changeset
fa8535a7ac3c
Takashi Sawanaka [Sun, 4 Dec 2016 13:38:10 +0000 (22:38 +0900)]
Bump revision to 2.14.0+-jp-124
Takashi Sawanaka [Sun, 4 Dec 2016 11:38:32 +0000 (20:38 +0900)]
Replace env_* with env::*
Takashi Sawanaka [Sun, 4 Dec 2016 11:00:04 +0000 (20:00 +0900)]
Replace paths_* with paths::*
Takashi Sawanaka [Sun, 4 Dec 2016 07:37:19 +0000 (16:37 +0900)]
Retry to detect the encoding of a file using all content when occurred encoding error. fixes github-issue#13.
Takashi Sawanaka [Fri, 2 Dec 2016 13:57:48 +0000 (22:57 +0900)]
Merge pull request #12 from Lippe35/master
Corrections and add missing translation (Portuguese.isl) Part3
Lippe35 [Fri, 2 Dec 2016 10:32:35 +0000 (10:32 +0000)]
Corrections and add missing translation (Portuguese.isl) Part3
Takashi Sawanaka [Thu, 1 Dec 2016 14:39:21 +0000 (23:39 +0900)]
Merge pull request #11 from Lippe35/master
More add missing translation (Portuguese.isl)
Takashi Sawanaka [Thu, 1 Dec 2016 14:38:58 +0000 (23:38 +0900)]
Merge pull request #10 from Lippe35/master
Add missing translation (Portuguese.isl)
Lippe35 [Wed, 30 Nov 2016 19:17:34 +0000 (19:17 +0000)]
More add missing translation (Portuguese.isl)
Lippe35 [Wed, 30 Nov 2016 18:11:00 +0000 (18:11 +0000)]
Add missing translation (Portuguese.isl)
Takashi Sawanaka [Wed, 30 Nov 2016 15:06:34 +0000 (00:06 +0900)]
Added tag 2.14.0+-jp-123 for changeset
0b52022c996c
Takashi Sawanaka [Wed, 30 Nov 2016 15:05:53 +0000 (00:05 +0900)]
Bump revision to 2.14.0+-jp-123
Takashi Sawanaka [Tue, 29 Nov 2016 14:57:37 +0000 (23:57 +0900)]
Added tag 2.14.0+-jp-122 for changeset
c695cb7835ff
Takashi Sawanaka [Tue, 29 Nov 2016 14:37:00 +0000 (23:37 +0900)]
Merge
Takashi Sawanaka [Sun, 27 Nov 2016 14:11:29 +0000 (23:11 +0900)]
Bump revision to 2.14.0+-jp-122
Takashi Sawanaka [Sun, 27 Nov 2016 12:17:12 +0000 (21:17 +0900)]
BuildBin.cmd: The file "2" was created after BuildBin.cmd was executed.
Takashi Sawanaka [Sun, 27 Nov 2016 11:32:14 +0000 (20:32 +0900)]
MergeDoc.cpp: Use std::int64_t instead of boost::int64_t
Takashi Sawanaka [Sun, 27 Nov 2016 11:24:22 +0000 (20:24 +0900)]
Merge.rc: fine-tune button position
Takashi Sawanaka [Sun, 27 Nov 2016 11:23:26 +0000 (20:23 +0900)]
Remove unused #include directives
Takashi Sawanaka [Sat, 26 Nov 2016 13:35:52 +0000 (22:35 +0900)]
paths.*: Add paths_ToWindowsPath() and paths_ToUnixPath() function
Takashi Sawanaka [Sat, 26 Nov 2016 11:04:17 +0000 (20:04 +0900)]
FolderCompare.exe: make FolderCompare.exe buildable with MinGW again
Takashi Sawanaka [Sat, 19 Nov 2016 21:48:12 +0000 (06:48 +0900)]
Merge
Takashi Sawanaka [Sat, 19 Nov 2016 21:42:55 +0000 (06:42 +0900)]
Remove wrongly pushed WinIMerge sources
Takashi Sawanaka [Sat, 19 Nov 2016 21:07:14 +0000 (06:07 +0900)]
Merge pull request #9 from Lippe35/master
Fix line 358 (Portuguese.isl)
Lippe35 [Sat, 19 Nov 2016 14:44:30 +0000 (14:44 +0000)]
Fix line 358 (Portuguese.isl)
Takashi Sawanaka [Fri, 18 Nov 2016 14:15:14 +0000 (23:15 +0900)]
Merge pull request #8 from Lippe35/master
Corrections and Add missing translation (Portuguese.po) Part6
Lippe35 [Fri, 18 Nov 2016 06:58:36 +0000 (06:58 +0000)]
Corrections and Add missing translation (Portuguese.po) Part6
Add missing translation in (Portuguese.isl)
Takashi Sawanaka [Sun, 13 Nov 2016 10:47:10 +0000 (19:47 +0900)]
Added tag 2.14.0+-jp-121 for changeset
9d85a0db6c7d
Takashi Sawanaka [Sun, 13 Nov 2016 10:44:00 +0000 (19:44 +0900)]
Bump revision to 2.14.0+-jp-121
Takashi Sawanaka [Sun, 13 Nov 2016 10:42:53 +0000 (19:42 +0900)]
Update WinIMerge to 1.0.4.0
Takashi Sawanaka [Sun, 13 Nov 2016 09:18:56 +0000 (18:18 +0900)]
Bump revision to 1.0.4.0
Takashi Sawanaka [Sun, 13 Nov 2016 09:04:21 +0000 (18:04 +0900)]
- Make diff block blinkable
- Add 'Alpha Animation' item to 'Overlay' combobox
Takashi Sawanaka [Sun, 6 Nov 2016 13:02:31 +0000 (22:02 +0900)]
CrystalEdit Sample: Fix crash when loading a file that includes a line over 256 chars