Skip to content

Commit 262d237

Browse files
committed
Strip paths that might have quotes.
1 parent d96b2a8 commit 262d237

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

Chizl.FileComparer/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// Revision
3131
//
3232
[assembly: AssemblyVersion("5.9.0.0")]
33-
[assembly: AssemblyFileVersion("5.9.17.1006")]
33+
[assembly: AssemblyFileVersion("5.9.17.1306")]
3434
[assembly: AssemblyInformationalVersion("5.9.17.0")]
3535
[assembly: AssemblyKeyFileAttribute("")]
3636
[assembly: AssemblyDelaySignAttribute(false)]

Chizl.FileComparer/StartForm.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using System.Collections.Concurrent;
1313
using System.Runtime.InteropServices;
1414
using System.Text.RegularExpressions;
15+
using System.Threading.Tasks;
1516

1617
namespace Chizl.FileComparer
1718
{
@@ -318,8 +319,8 @@ private void CompareFiles()
318319
// this.OldAsciiContent.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
319320
// this.NewAsciiContent.Font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point, ((byte)(0)));
320321

321-
SplitContainer1.Panel1Collapsed = false;
322-
SplitContainer1.Panel2Collapsed = false;
322+
this.SplitContainer1.Panel1Collapsed = false;
323+
this.SplitContainer1.Panel2Collapsed = false;
323324

324325
ClearRichText();
325326

@@ -331,19 +332,24 @@ private void CompareFiles()
331332
score_threshold = .30;
332333
}
333334

334-
// Add OLD_DROPDOWN as the value, to represent Old File downdown component. If Key already exists, check existing
335-
// value and if New File dropdown (2), make it 3, to represent both Old and New should have it.
336-
// If existing value isn't 2, leave it as it, because 1 or 3 already exists.
337-
_fileHistory.AddOrUpdate(this.OldAsciiFile.Text.Trim(), OLD_DROPDOWN,
335+
// remove any quotes
336+
var oldFile = this.OldAsciiFile.Text.Replace("\"", "").Replace("'", "");
337+
var newFile = this.NewAsciiFile.Text.Replace("\"", "").Replace("'", "");
338+
339+
Task.Run(() => { _lastFileComparison = DiffTool.CompareFiles(oldFile, newFile, score_threshold, 3); }).Wait();
340+
341+
// Add OLD_DROPDOWN as the value, to represent Old File downdown component. If Key already exists,
342+
// check existingvalue and if New File dropdown (2), make it 3, to represent both Old and New
343+
// should have it. If existing value isn't 2, leave it as it, because 1 or 3 already exists.
344+
_fileHistory.AddOrUpdate(oldFile.Trim(), OLD_DROPDOWN,
338345
(key, existingValue) => { return existingValue == NEW_DROPDOWN ? OLD_NEW_DROPDOWN : existingValue; });
339346

340347
// Add 2 as the value, to represent New File downdown component. If Key already exists, check existing
341348
// value and if Old File dropdown (1), make it 3, to represent both Old and New should have it.
342349
// If existing value isn't 1, leave it as it, because 2 or 3 already exists.
343-
_fileHistory.AddOrUpdate(this.NewAsciiFile.Text.Trim(), NEW_DROPDOWN,
350+
_fileHistory.AddOrUpdate(newFile.Trim(), NEW_DROPDOWN,
344351
(key, existingValue) => { return existingValue == OLD_DROPDOWN ? OLD_NEW_DROPDOWN : existingValue; });
345352

346-
_lastFileComparison = DiffTool.CompareFiles(this.OldAsciiFile.Text, this.NewAsciiFile.Text, score_threshold, 3);
347353
this.ViewAsBinaryButtonToollbar.Visible = !_lastFileComparison.IsBinary;
348354

349355
if (_lastFileComparison.HasException)

0 commit comments

Comments
 (0)