[Winmerge-svn] SF.net SVN: winmerge:[6808] branches/R2_12
Windows visual diff and merge for files and directories
Brought to you by:
christianlist,
grimmdp
From: <ki...@us...> - 2009-06-01 16:53:07
|
Revision: 6808 http://winmerge.svn.sourceforge.net/winmerge/?rev=6808&view=rev Author: kimmov Date: 2009-06-01 16:52:57 +0000 (Mon, 01 Jun 2009) Log Message: ----------- BUG: [ 2791506 ] Wrong Timestamps in Generaged Patch First patch and fix idea submitted by Liisachan (seelie at sourceforge) Modified Paths: -------------- branches/R2_12/Docs/Users/ChangeLog.txt branches/R2_12/Src/DiffWrapper.cpp Modified: branches/R2_12/Docs/Users/ChangeLog.txt =================================================================== --- branches/R2_12/Docs/Users/ChangeLog.txt 2009-06-01 15:33:30 UTC (rev 6807) +++ branches/R2_12/Docs/Users/ChangeLog.txt 2009-06-01 16:52:57 UTC (rev 6808) @@ -15,6 +15,7 @@ mixed-eol files (#2022312) Bugfix: Didn't show correct EOL chars if whitespace chars were turned off and again on (#2791402) + Bugfix: Generated patch had wrong file time for UTF-16 files (#2791506) WinMerge 2.12.2 - 2009-04-01 (r6625) Disable folder compare tree-view by default (#2714968) Modified: branches/R2_12/Src/DiffWrapper.cpp =================================================================== --- branches/R2_12/Src/DiffWrapper.cpp 2009-06-01 15:33:30 UTC (rev 6807) +++ branches/R2_12/Src/DiffWrapper.cpp 2009-06-01 16:52:57 UTC (rev 6808) @@ -25,6 +25,8 @@ // $Id$ #include "StdAfx.h" +#include <sys/types.h> +#include <sys/stat.h> #include <string> #include <map> #include <shlwapi.h> @@ -45,6 +47,7 @@ #include "FilterCommentsManager.h" #include "Environment.h" #include "AnsiConvert.h" +#include "UnicodeString.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -1226,6 +1229,19 @@ inf_patch[0].name = ansiconvert_SystemCP(path1.c_str()); inf_patch[1].name = ansiconvert_SystemCP(path2.c_str()); + // Fix timestamps for generated patch files + // If there are translations needed (e.g. when comparing UTF-16 files) + // then the stats in 'inf' are read from temp files. If the original + // file's and read timestamps differ, use original file's timestamps. + // See also sf.net bug item #2791506. + struct __stat64 st; + _tstat64(path1.c_str(), &st); + if (st.st_mtime != inf_patch[0].stat.st_mtime) + inf_patch[0].stat.st_mtime = st.st_mtime; + _tstat64(path2.c_str(), &st); + if (st.st_mtime != inf_patch[1].stat.st_mtime) + inf_patch[1].stat.st_mtime = st.st_mtime; + outfile = NULL; if (!m_sPatchFile.IsEmpty()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |