From 78e67e94cb1d06c9fce6f2152fe2dd80e5671435 Mon Sep 17 00:00:00 2001 From: pierre Date: Fri, 14 Jan 2000 15:36:42 +0000 Subject: [PATCH] + GetShortFileName used for tcodeeditor file opening --- ide/text/weditor.pas | 7 +++++-- ide/text/wutils.pas | 31 ++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/ide/text/weditor.pas b/ide/text/weditor.pas index 5dbd398a00..c65da21c8e 100644 --- a/ide/text/weditor.pas +++ b/ide/text/weditor.pas @@ -4993,7 +4993,7 @@ function TFileEditor.LoadFile: boolean; var S: PBufStream; OK: boolean; begin - New(S, Init(FileName,stOpenRead,EditorTextBufSize)); + New(S, Init(GetShortName(FileName),stOpenRead,EditorTextBufSize)); OK:=Assigned(S); {$ifdef TEST_PARTIAL_SYNTAX} SyntaxComplete:=false; @@ -5517,7 +5517,10 @@ end; END. { $Log$ - Revision 1.74 2000-01-10 23:20:04 pierre + Revision 1.75 2000-01-14 15:36:42 pierre + + GetShortFileName used for tcodeeditor file opening + + Revision 1.74 2000/01/10 23:20:04 pierre * problem with Paste solved Revision 1.73 2000/01/10 13:25:46 pierre diff --git a/ide/text/wutils.pas b/ide/text/wutils.pas index 8500546149..794c3c515f 100644 --- a/ide/text/wutils.pas +++ b/ide/text/wutils.pas @@ -97,6 +97,8 @@ function NameAndExtOf(const S: string): string; function DirAndNameOf(const S: string): string; { return Dos GetFTime value or -1 if the file does not exist } function GetFileTime(const FileName: string): longint; +{ copied from compiler global unit } +function GetShortName(const n:string):string; function EatIO: integer; @@ -347,6 +349,30 @@ begin GetFileTime:=T; end; +function GetShortName(const n:string):string; +{$ifdef win32} + var + hs,hs2 : string; +{$endif} +{$ifdef go32v2} + var + hs : string; +{$endif} + begin + GetShortName:=n; +{$ifdef win32} + hs:=n+#0; + Windows.GetShortPathName(@hs[1],@hs2[1],high(hs2)); + hs2[0]:=chr(strlen(@hs2[1])); + GetShortName:=hs2; +{$endif} +{$ifdef go32v2} + hs:=n; + if Dos.GetShortName(hs) then + GetShortName:=hs; +{$endif} + end; + function EatIO: integer; begin @@ -535,7 +561,10 @@ end; END. { $Log$ - Revision 1.11 2000-01-05 17:27:20 pierre + Revision 1.12 2000-01-14 15:36:43 pierre + + GetShortFileName used for tcodeeditor file opening + + Revision 1.11 2000/01/05 17:27:20 pierre + linecomplete arg for ReadlnFromStream Revision 1.10 2000/01/03 11:38:35 michael