Trim fname to fix cases of dbl dirsep under win

This commit is contained in:
Basile Burg 2018-03-17 05:17:11 +01:00
parent b093cb3a9c
commit 76d3fdafc2
2 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@ unit ce_dcd;
interface
uses
Classes, SysUtils, process, forms, strutils,
Classes, SysUtils, process, forms, strutils, LazFileUtils,
{$IFDEF WINDOWS}
windows,
{$ENDIF}
@ -589,7 +589,7 @@ begin
if i = -1 then
exit;
loc := str[i+1..str.length];
fname := str[1..i-1];
fname := TrimFilename(str[1..i-1]);
loc := ReplaceStr(loc, LineEnding, '');
position := strToIntDef(loc, -1);
end;

View File

@ -6,7 +6,7 @@ interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, lcltype, Graphics, SynEditKeyCmds,
ComCtrls, SynEditHighlighter, ExtCtrls, Menus, SynMacroRecorder, dialogs,
ComCtrls, SynEditHighlighter, ExtCtrls, Menus, SynMacroRecorder, dialogs, LazFileUtils,
SynPluginSyncroEdit, SynEdit, SynHighlighterMulti, ce_dialogs,
ce_widget, ce_interfaces, ce_synmemo, ce_dlang, ce_common, ce_dcd, ce_observer,
ce_sharedres, ce_controls, ce_writableComponent, ce_dsgncontrols;
@ -561,7 +561,7 @@ begin
for i := 0 to PageControl.PageCount-1 do
begin
result := getDocument(i);
if SameFileName(result.fileName, fname) then
if SameFileName(result.fileName, TrimFilename(fname)) then
exit;
end;
result := nil;
@ -579,7 +579,7 @@ begin
exit;
end;
doc := TCESynMemo.Create(nil);
fDoc.loadFromFile(fname);
fDoc.loadFromFile(TrimFilename(fname));
if assigned(fProj) and (fProj.filename = fDoc.fileName) then
begin
if fProj.getFormat = pfCE then