wp-xyz / Hex

Hex editor designed for analyzing binary files.
MIT License
55 stars 21 forks source link

[Linux] File name as parameter not recognized #2

Closed rchastain closed 1 year ago

rchastain commented 1 year ago

If I drop a file on Hex (the executable), the editor doesn't open the file.

The problem is here:

// hxmain.pas
procedure TMainForm.EvalCmdLine;
var
  s: string;
  i: integer;
begin
  for i:=1 to ParamCount do
  begin
    s := UpperCase(ParamStr(i));
    if (s[1]='/') or (s[1]='-') then
    begin
      //
    end else
      if FileExists(ParamStr(i)) then CreateEditor(ParamStr(i), HexParams.WriteProtected);
  end;
end;

On Linux full file names start with a '/'.

wp-xyz commented 1 year ago

Removed the option that cmd line arguments can begin with '/'.