Changeset 29


Ignore:
Timestamp:
Feb 13, 2012, 7:21:04 PM (12 years ago)
Author:
chronos
Message:
  • Fixed: Distinguish between windows and linux long file name commandline handling.
Location:
trunk/Compiler
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Compiler/UCompiler.pas

    r28 r29  
    66
    77uses
    8   Classes, SysUtils, StrUtils, Registry, URegistry, SpecializedList,
     8  Classes, SysUtils, StrUtils, Registry, URegistry, SpecializedList, Dialogs,
    99  FileUtil, Process;
    1010
     
    1818    Indent: Integer;
    1919    procedure AddLine(Text: string);
     20    function LongFileName(FileName: string): string;
    2021  public
    2122    Name: string;
     
    9394end;
    9495
     96function TBrainFuckCompiler.LongFileName(FileName: string): string;
     97begin
     98  Result := FileName;
     99  {$IFDEF Windows}
     100  Result := '"' + FileName + '"';
     101  {$ENDIF}
     102  {$IFDEF Linux}
     103  Result := StringReplace(FileName, ' ', '\ ', [rfReplaceAll]);
     104  {$ENDIF}
     105end;
     106
    95107constructor TBrainFuckCompiler.Create;
    96108begin
     
    129141    Process := TProcess.Create(nil);
    130142    Process.CurrentDirectory := ExtractFilePath(CompilerPath);
    131     Process.CommandLine := '"' + CompilerPath + '" "' + CompiledFile + '"';
     143    Process.CommandLine := LongFileName(CompilerPath) + ' ' + LongFileName(CompiledFile);
    132144    Process.Options := [poWaitOnExit];
    133145    Process.Execute;
     
    148160  try
    149161    Process := TProcess.Create(nil);
    150     Process.CommandLine := '"' + CompiledFile + '"';
     162    Process.CommandLine := LongFileName(CompiledFile);
    151163    Process.Options := [poWaitOnExit];
    152164    Process.Execute;
  • trunk/Compiler/UCompilerC.pas

    r28 r29  
    66
    77uses
    8   Classes, SysUtils, FileUtil, UCompiler, Process;
     8  Classes, SysUtils, FileUtil, UCompiler, Process, Dialogs;
    99
    1010type
     
    124124    Process := TProcess.Create(nil);
    125125    Process.CurrentDirectory := ExtractFilePath(CompilerPath);
    126     Process.CommandLine := '"' + CompilerPath + '" "' + CompiledFile + '" -o ' +
    127       ExtractFilePath(CompiledFile) + ExtractFileNameOnly(CompiledFile) + CompiledExtension;
     126    Process.CommandLine := LongFileName(CompilerPath) + ' ' + LongFileName(CompiledFile) + ' -o ' +
     127      LongFileName(ExtractFilePath(CompiledFile) + ExtractFileNameOnly(CompiledFile) + CompiledExtension);
    128128    Process.Options := [poWaitOnExit];
    129129    Process.Execute;
Note: See TracChangeset for help on using the changeset viewer.