Changeset 29
- Timestamp:
- Feb 13, 2012, 7:21:04 PM (13 years ago)
- Location:
- trunk/Compiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/UCompiler.pas
r28 r29 6 6 7 7 uses 8 Classes, SysUtils, StrUtils, Registry, URegistry, SpecializedList, 8 Classes, SysUtils, StrUtils, Registry, URegistry, SpecializedList, Dialogs, 9 9 FileUtil, Process; 10 10 … … 18 18 Indent: Integer; 19 19 procedure AddLine(Text: string); 20 function LongFileName(FileName: string): string; 20 21 public 21 22 Name: string; … … 93 94 end; 94 95 96 function TBrainFuckCompiler.LongFileName(FileName: string): string; 97 begin 98 Result := FileName; 99 {$IFDEF Windows} 100 Result := '"' + FileName + '"'; 101 {$ENDIF} 102 {$IFDEF Linux} 103 Result := StringReplace(FileName, ' ', '\ ', [rfReplaceAll]); 104 {$ENDIF} 105 end; 106 95 107 constructor TBrainFuckCompiler.Create; 96 108 begin … … 129 141 Process := TProcess.Create(nil); 130 142 Process.CurrentDirectory := ExtractFilePath(CompilerPath); 131 Process.CommandLine := '"' + CompilerPath + '" "' + CompiledFile + '"';143 Process.CommandLine := LongFileName(CompilerPath) + ' ' + LongFileName(CompiledFile); 132 144 Process.Options := [poWaitOnExit]; 133 145 Process.Execute; … … 148 160 try 149 161 Process := TProcess.Create(nil); 150 Process.CommandLine := '"' + CompiledFile + '"';162 Process.CommandLine := LongFileName(CompiledFile); 151 163 Process.Options := [poWaitOnExit]; 152 164 Process.Execute; -
trunk/Compiler/UCompilerC.pas
r28 r29 6 6 7 7 uses 8 Classes, SysUtils, FileUtil, UCompiler, Process ;8 Classes, SysUtils, FileUtil, UCompiler, Process, Dialogs; 9 9 10 10 type … … 124 124 Process := TProcess.Create(nil); 125 125 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); 128 128 Process.Options := [poWaitOnExit]; 129 129 Process.Execute;
Note:
See TracChangeset
for help on using the changeset viewer.