mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Quote file names when adding to command line.
This commit is contained in:
parent
c17dca0ab0
commit
470e501dc5
2 changed files with 9 additions and 13 deletions
|
|
@ -3163,7 +3163,7 @@ begin
|
|||
iIndex:= Pos('cd ', sCmd);
|
||||
if iIndex = 1 then
|
||||
begin
|
||||
sDir:= Trim(Copy(sCmd, iIndex + 3, Length(sCmd)));
|
||||
sDir:= Trim(RemoveQuotation(Copy(sCmd, iIndex + 3, Length(sCmd))));
|
||||
sDir:= IncludeTrailingBackslash(sDir);
|
||||
if Pos('~' + PathDelim, sDir) = 1 then
|
||||
sDir:= StringReplace(sDir, '~' + PathDelim, GetHomeDir, []);
|
||||
|
|
|
|||
|
|
@ -715,12 +715,14 @@ end;
|
|||
procedure TActs.cm_AddPathToCmdLine(param:string);
|
||||
var
|
||||
OldPosition: Integer;
|
||||
AddedString: String;
|
||||
begin
|
||||
with frmMain do
|
||||
begin
|
||||
OldPosition := edtCommand.SelStart;
|
||||
edtCommand.Text := edtCommand.Text + (ActiveFrame.CurrentPath);
|
||||
edtCommand.SelStart := OldPosition + Length(ActiveFrame.CurrentPath);
|
||||
AddedString := QuoteStr(ActiveFrame.CurrentPath);
|
||||
edtCommand.Text := edtCommand.Text + AddedString;
|
||||
edtCommand.SelStart := OldPosition + Length(AddedString);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -736,7 +738,7 @@ begin
|
|||
if Assigned(aFile) then
|
||||
begin
|
||||
OldPosition := edtCommand.SelStart;
|
||||
AddedString := aFile.Name + ' ';
|
||||
AddedString := QuoteStr(aFile.Name) + ' ';
|
||||
edtCommand.Text := edtCommand.Text + AddedString;
|
||||
edtCommand.SelStart := OldPosition + Length(AddedString);
|
||||
end;
|
||||
|
|
@ -754,16 +756,10 @@ begin
|
|||
aFile := ActiveFrame.ActiveFile;
|
||||
if Assigned(aFile) then
|
||||
begin
|
||||
AddedString := ActiveFrame.CurrentPath;
|
||||
|
||||
if aFile.Name = '..' then
|
||||
begin
|
||||
AddedString := AddedString + ' ';
|
||||
end
|
||||
AddedString := QuoteStr(ActiveFrame.CurrentPath) + ' '
|
||||
else
|
||||
begin
|
||||
AddedString := AddedString + aFile.Name + ' ';
|
||||
end;
|
||||
AddedString := QuoteStr(aFile.FullPath) + ' ';
|
||||
|
||||
OldPosition := edtCommand.SelStart;
|
||||
edtCommand.Text := edtCommand.Text + AddedString;
|
||||
|
|
@ -2714,4 +2710,4 @@ begin
|
|||
end;
|
||||
|
||||
end.
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue