Skip to content

Commit de0a309

Browse files
authored
Merge branch 'doublecmd:master' into master
2 parents 4261430 + 02ecead commit de0a309

127 files changed

Lines changed: 10973 additions & 6494 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

components/doublecmd/dcntfslinks.pas

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ interface
4343
IO_REPARSE_TAG_LX_SYMLINK = $A000001D;
4444

4545
const
46+
LX_SYMLINK_HEADER_SIZE = 4;
4647
REPARSE_DATA_HEADER_SIZE = 8;
4748
MOUNT_POINT_HEADER_SIZE = 8;
4849
FILE_DOES_NOT_EXIST = DWORD(-1);
@@ -119,6 +120,13 @@ function CreateHardLink(const AFileName, ALinkName: UnicodeString): Boolean;
119120
@returns(The function returns @true if successful, @false otherwise)
120121
}
121122
function ReadSymLink(const aSymlinkFileName: UnicodeString; out aTargetFileName: UnicodeString): Boolean;
123+
{en
124+
Creates a WSL/Cygwin symbolic link.
125+
@param(aTargetFileName The name of the existing file)
126+
@param(aSymlinkFileName The name of the symbolic link)
127+
@returns(The function returns @true if successful, @false otherwise)
128+
}
129+
function CreateSymLinkUnix(const aTargetFileName: String; const aSymlinkFileName: UnicodeString): Boolean;
122130

123131
implementation
124132

@@ -357,6 +365,55 @@ function CreateSymLink(const ATargetName, ALinkName: UnicodeString; Attr: UInt32
357365
end;
358366
end;
359367

368+
function CreateSymLinkUnix(const aTargetFileName: String; const aSymlinkFileName: UnicodeString): Boolean;
369+
var
370+
hDevice: THandle;
371+
dwLastError: DWORD;
372+
nInBufferSize: DWORD;
373+
dwPathBufferSize: DWORD;
374+
lpBytesReturned: DWORD = 0;
375+
lpInBuffer: PReparseDataBuffer;
376+
begin
377+
hDevice:= CreateFileW(PWideChar(aSymlinkFileName),
378+
GENERIC_WRITE, 0, nil, CREATE_NEW,
379+
FILE_FLAG_OPEN_REPARSE_POINT, 0);
380+
if hDevice = INVALID_HANDLE_VALUE then Exit(False);
381+
dwPathBufferSize:= Length(aTargetFileName);
382+
nInBufferSize:= REPARSE_DATA_HEADER_SIZE + LX_SYMLINK_HEADER_SIZE + dwPathBufferSize;
383+
lpInBuffer:= GetMem(nInBufferSize);
384+
ZeroMemory(lpInBuffer, nInBufferSize);
385+
with lpInBuffer^, lpInBuffer^.LxSymlinkReparseBuffer do
386+
begin
387+
FileType:= 2; // symbolic link
388+
ReparseTag:= IO_REPARSE_TAG_LX_SYMLINK;
389+
ReparseDataLength:= LX_SYMLINK_HEADER_SIZE + dwPathBufferSize;
390+
CopyMemory(@PathBuffer[0], @aTargetFileName[1], Length(aTargetFileName));
391+
end;
392+
Result:= DeviceIoControl(hDevice, // handle to file or directory
393+
FSCTL_SET_REPARSE_POINT, // dwIoControlCode
394+
lpInBuffer, // input buffer
395+
nInBufferSize, // size of input buffer
396+
nil, // lpOutBuffer
397+
0, // nOutBufferSize
398+
lpBytesReturned, // lpBytesReturned
399+
nil); // OVERLAPPED structure
400+
// File system does not support reparse points
401+
// Create a normal file with the link target inside
402+
if (not Result) and (GetLastError = ERROR_INVALID_FUNCTION) then
403+
begin
404+
Result:= (FileWrite(hDevice, aTargetFileName[1], dwPathBufferSize) = dwPathBufferSize);
405+
if Result then SetFileAttributesW(PWideChar(aSymlinkFileName), FILE_ATTRIBUTE_SYSTEM);
406+
end;
407+
if not Result then dwLastError:= GetLastError;
408+
FreeMem(lpInBuffer);
409+
CloseHandle(hDevice);
410+
if not Result then
411+
begin
412+
DeleteFileW(PWideChar(aSymlinkFileName));
413+
SetLastError(dwLastError);
414+
end;
415+
end;
416+
360417
function ReadSymLink(const aSymlinkFileName: UnicodeString; out aTargetFileName: UnicodeString): Boolean;
361418
var
362419
L: Integer;

components/doublecmd/dcosutils.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,7 @@ function mbFileOpen(const FileName: String; Mode: LongWord): System.THandle;
887887
if (Mode and fmOpenNoATime <> 0) then
888888
begin
889889
if (Result <> feInvalidHandle) then
890-
SetFileTime(Result, nil, @ft, @ft)
890+
SetFileTime(Result, nil, @ft, nil)
891891
else if GetLastError = ERROR_ACCESS_DENIED then
892892
Result := mbFileOpen(FileName, Mode and not fmOpenNoATime);
893893
end;

components/synunihighlighter/source/SynUniHighlighter.pas

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,11 @@ TSynUniSyn = class(TSynCustomHighlighter)
138138
implementation
139139

140140
uses
141-
CRC, Laz2_XMLRead;
141+
CRC, Laz2_XMLRead, LCLVersion;
142142

143143
//==== TSynUniSyn ============================================================
144144
constructor TSynUniSyn.Create(AOwner: TComponent);
145145
begin
146-
inherited Create(AOwner);
147146
Info := TSynInfo.Create;
148147
Info.History := TStringList.Create;
149148
Info.Sample := TStringList.Create;
@@ -157,6 +156,8 @@ constructor TSynUniSyn.Create(AOwner: TComponent);
157156
fEol := False;
158157
fPrEol := False;
159158
fCurrentRule := MainRules;
159+
160+
inherited Create(AOwner);
160161
end;
161162

162163
destructor TSynUniSyn.Destroy;
@@ -702,6 +703,9 @@ procedure TSynUniSyn.LoadFromStream(Stream: TStream; FreeStream: boolean);
702703
ReadXMLFile(Xml, TargetStream, [xrfPreserveWhiteSpace]);
703704
try
704705
LoadFromXml(Xml);
706+
{$if lcl_fullversion >= 4990000}
707+
DefaultFilter:= GetDefaultFilter;
708+
{$endif}
705709
finally
706710
Xml.Free;
707711
end;
@@ -725,6 +729,9 @@ procedure TSynUniSyn.SaveToStream(Stream: TStream; Rule: TSynRule);
725729
var
726730
StreamWriter: TStreamWriter;
727731
begin
732+
{$if lcl_fullversion >= 4990000}
733+
SetDefaultFilter(DefaultFilter);
734+
{$endif}
728735
StreamWriter := TStreamWriter.Create(Stream);
729736
with StreamWriter do begin
730737
WriteTag(0, 'UniHighlighter');

doublecmd.help

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
ru
1+
ru
2+
zh

language/doublecmd.be.po

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,23 +518,31 @@ msgid "Cancel"
518518
msgstr "Скасаваць"
519519

520520
#: tfrmdiffer.actcopylefttoright.caption
521+
#, fuzzy
522+
#| msgid "Copy Block Right"
521523
msgctxt "tfrmdiffer.actcopylefttoright.caption"
522-
msgid "Copy Block Right"
524+
msgid "Copy Block To Right"
523525
msgstr "Скапіяваць блок управа"
524526

525527
#: tfrmdiffer.actcopylefttoright.hint
528+
#, fuzzy
529+
#| msgid "Copy Block Right"
526530
msgctxt "TFRMDIFFER.ACTCOPYLEFTTORIGHT.HINT"
527-
msgid "Copy Block Right"
531+
msgid "Copy Block From Left To Right"
528532
msgstr "Скапіяваць блок управа"
529533

530534
#: tfrmdiffer.actcopyrighttoleft.caption
535+
#, fuzzy
536+
#| msgid "Copy Block Left"
531537
msgctxt "tfrmdiffer.actcopyrighttoleft.caption"
532-
msgid "Copy Block Left"
538+
msgid "Copy Block To Left"
533539
msgstr "Скапіяваць блок улева"
534540

535541
#: tfrmdiffer.actcopyrighttoleft.hint
542+
#, fuzzy
543+
#| msgid "Copy Block Left"
536544
msgctxt "TFRMDIFFER.ACTCOPYRIGHTTOLEFT.HINT"
537-
msgid "Copy Block Left"
545+
msgid "Copy Block From Right To Left"
538546
msgstr "Скапіяваць блок улева"
539547

540548
#: tfrmdiffer.acteditcopy.caption

language/doublecmd.bg.po

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,23 +523,31 @@ msgid "Cancel"
523523
msgstr "Отказ"
524524

525525
#: tfrmdiffer.actcopylefttoright.caption
526+
#, fuzzy
527+
#| msgid "Copy Block Right"
526528
msgctxt "TFRMDIFFER.ACTCOPYLEFTTORIGHT.CAPTION"
527-
msgid "Copy Block Right"
529+
msgid "Copy Block To Right"
528530
msgstr "Замяна в дясното крило със съдържанието от лявото"
529531

530532
#: tfrmdiffer.actcopylefttoright.hint
533+
#, fuzzy
534+
#| msgid "Copy Block Right"
531535
msgctxt "TFRMDIFFER.ACTCOPYLEFTTORIGHT.HINT"
532-
msgid "Copy Block Right"
536+
msgid "Copy Block From Left To Right"
533537
msgstr "Замяна в дясното крило със съдържанието от лявото"
534538

535539
#: tfrmdiffer.actcopyrighttoleft.caption
540+
#, fuzzy
541+
#| msgid "Copy Block Left"
536542
msgctxt "TFRMDIFFER.ACTCOPYRIGHTTOLEFT.CAPTION"
537-
msgid "Copy Block Left"
543+
msgid "Copy Block To Left"
538544
msgstr "Замяна в лявото крило със съдържанието от дясното"
539545

540546
#: tfrmdiffer.actcopyrighttoleft.hint
547+
#, fuzzy
548+
#| msgid "Copy Block Left"
541549
msgctxt "TFRMDIFFER.ACTCOPYRIGHTTOLEFT.HINT"
542-
msgid "Copy Block Left"
550+
msgid "Copy Block From Right To Left"
543551
msgstr "Замяна в лявото крило със съдържанието от дясното"
544552

545553
#: tfrmdiffer.acteditcopy.caption

language/doublecmd.ca.po

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,23 +588,31 @@ msgid "Cancel"
588588
msgstr "Cancel·la"
589589

590590
#: tfrmdiffer.actcopylefttoright.caption
591+
#, fuzzy
592+
#| msgid "Copy Block Right"
591593
msgctxt "TFRMDIFFER.ACTCOPYLEFTTORIGHT.CAPTION"
592-
msgid "Copy Block Right"
594+
msgid "Copy Block To Right"
593595
msgstr "Copia bloc dret"
594596

595597
#: tfrmdiffer.actcopylefttoright.hint
598+
#, fuzzy
599+
#| msgid "Copy Block Right"
596600
msgctxt "TFRMDIFFER.ACTCOPYLEFTTORIGHT.HINT"
597-
msgid "Copy Block Right"
601+
msgid "Copy Block From Left To Right"
598602
msgstr "Copia bloc dret"
599603

600604
#: tfrmdiffer.actcopyrighttoleft.caption
605+
#, fuzzy
606+
#| msgid "Copy Block Left"
601607
msgctxt "TFRMDIFFER.ACTCOPYRIGHTTOLEFT.CAPTION"
602-
msgid "Copy Block Left"
608+
msgid "Copy Block To Left"
603609
msgstr "Copia bloc esquerra"
604610

605611
#: tfrmdiffer.actcopyrighttoleft.hint
612+
#, fuzzy
613+
#| msgid "Copy Block Left"
606614
msgctxt "TFRMDIFFER.ACTCOPYRIGHTTOLEFT.HINT"
607-
msgid "Copy Block Left"
615+
msgid "Copy Block From Right To Left"
608616
msgstr "Copia bloc esquerra"
609617

610618
#: tfrmdiffer.acteditcopy.caption

language/doublecmd.cs.po

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,23 +515,31 @@ msgid "Cancel"
515515
msgstr "Zrušit"
516516

517517
#: tfrmdiffer.actcopylefttoright.caption
518+
#, fuzzy
519+
#| msgid "Copy Block Right"
518520
msgctxt "TFRMDIFFER.ACTCOPYLEFTTORIGHT.CAPTION"
519-
msgid "Copy Block Right"
521+
msgid "Copy Block To Right"
520522
msgstr "Kopírovat doprava"
521523

522524
#: tfrmdiffer.actcopylefttoright.hint
525+
#, fuzzy
526+
#| msgid "Copy Block Right"
523527
msgctxt "TFRMDIFFER.ACTCOPYLEFTTORIGHT.HINT"
524-
msgid "Copy Block Right"
528+
msgid "Copy Block From Left To Right"
525529
msgstr "Kopírovat doprava"
526530

527531
#: tfrmdiffer.actcopyrighttoleft.caption
532+
#, fuzzy
533+
#| msgid "Copy Block Left"
528534
msgctxt "TFRMDIFFER.ACTCOPYRIGHTTOLEFT.CAPTION"
529-
msgid "Copy Block Left"
535+
msgid "Copy Block To Left"
530536
msgstr "Kopírovat doleva"
531537

532538
#: tfrmdiffer.actcopyrighttoleft.hint
539+
#, fuzzy
540+
#| msgid "Copy Block Left"
533541
msgctxt "TFRMDIFFER.ACTCOPYRIGHTTOLEFT.HINT"
534-
msgid "Copy Block Left"
542+
msgid "Copy Block From Right To Left"
535543
msgstr "Kopírovat doleva"
536544

537545
#: tfrmdiffer.acteditcopy.caption

language/doublecmd.da.po

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,23 +544,31 @@ msgid "Cancel"
544544
msgstr "&Annuller"
545545

546546
#: tfrmdiffer.actcopylefttoright.caption
547+
#, fuzzy
548+
#| msgid "Copy Block Right"
547549
msgctxt "tfrmdiffer.actcopylefttoright.caption"
548-
msgid "Copy Block Right"
550+
msgid "Copy Block To Right"
549551
msgstr "Kopier blok til &højre"
550552

551553
#: tfrmdiffer.actcopylefttoright.hint
554+
#, fuzzy
555+
#| msgid "Copy Block Right"
552556
msgctxt "TFRMDIFFER.ACTCOPYLEFTTORIGHT.HINT"
553-
msgid "Copy Block Right"
557+
msgid "Copy Block From Left To Right"
554558
msgstr "Kopier blok til højre"
555559

556560
#: tfrmdiffer.actcopyrighttoleft.caption
561+
#, fuzzy
562+
#| msgid "Copy Block Left"
557563
msgctxt "tfrmdiffer.actcopyrighttoleft.caption"
558-
msgid "Copy Block Left"
564+
msgid "Copy Block To Left"
559565
msgstr "Kopier blok til &venstre"
560566

561567
#: tfrmdiffer.actcopyrighttoleft.hint
568+
#, fuzzy
569+
#| msgid "Copy Block Left"
562570
msgctxt "TFRMDIFFER.ACTCOPYRIGHTTOLEFT.HINT"
563-
msgid "Copy Block Left"
571+
msgid "Copy Block From Right To Left"
564572
msgstr "Kopier blok til venstre"
565573

566574
#: tfrmdiffer.acteditcopy.caption

language/doublecmd.de.po

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,23 +513,31 @@ msgid "Cancel"
513513
msgstr "Abbrechen"
514514

515515
#: tfrmdiffer.actcopylefttoright.caption
516+
#, fuzzy
517+
#| msgid "Copy Block Right"
516518
msgctxt "tfrmdiffer.actcopylefttoright.caption"
517-
msgid "Copy Block Right"
519+
msgid "Copy Block To Right"
518520
msgstr "Block nach rechts kopieren"
519521

520522
#: tfrmdiffer.actcopylefttoright.hint
523+
#, fuzzy
524+
#| msgid "Copy Block Right"
521525
msgctxt "TFRMDIFFER.ACTCOPYLEFTTORIGHT.HINT"
522-
msgid "Copy Block Right"
526+
msgid "Copy Block From Left To Right"
523527
msgstr "Block nach rechts kopieren"
524528

525529
#: tfrmdiffer.actcopyrighttoleft.caption
530+
#, fuzzy
531+
#| msgid "Copy Block Left"
526532
msgctxt "tfrmdiffer.actcopyrighttoleft.caption"
527-
msgid "Copy Block Left"
533+
msgid "Copy Block To Left"
528534
msgstr "Block nach links kopieren"
529535

530536
#: tfrmdiffer.actcopyrighttoleft.hint
537+
#, fuzzy
538+
#| msgid "Copy Block Left"
531539
msgctxt "TFRMDIFFER.ACTCOPYRIGHTTOLEFT.HINT"
532-
msgid "Copy Block Left"
540+
msgid "Copy Block From Right To Left"
533541
msgstr "Block nach links kopieren"
534542

535543
#: tfrmdiffer.acteditcopy.caption

0 commit comments

Comments
 (0)