I posted one message called "Bug 1068471 : Filename handling" and maybe someone thought that it is bug reporting.
However, it's not related to Dev-C++ or user programming.
On the bug 1068471, someone complained about "&" keyword and, unfortunately, windows file system accept this symbol for the filename.
The filenames contained "&" char in their filename must have quotation mark before and after filename.
I guess the function, GetMakePath, should change like this
In the 743 in utils.pas file
{ GenMakePath: convert a filename to a format that can be
used by make }
function GenMakePath(FileName: String): String;
begin
Result:=StringReplace(Filename, '\', '/', [rfReplaceAll]);
if (Pos(' ', Filename)>0) or (Pos('&', Filename)>0) then
Result := '"'+Result+'"';
end;
To keep the consistency between GetMakePath and GetMakePath2, why don't you change GetMakePath2 to like this :
function GenMakePath2(FileName: String): String;
var
S: String;
begin
Result := '';
{ Convert backslashes to slashes }
S:=StringReplace(Filename, '\', '/', [rfReplaceAll]);
Result := StringReplace(S, ' ', '/ ', [rfReplaceAll]);
end;
or
function GenMakePath2(FileName: String): String;
begin
Result := '';
{ Convert backslashes to slashes }
Filename:=StringReplace(Filename, '\', '/', [rfReplaceAll]);
Result := StringReplace(Filename, ' ', '/ ', [rfReplaceAll]);
end;
If this is not right post on this forum, please leave a comment on this post.
Sorry if this message bothers you guys
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I posted one message called "Bug 1068471 : Filename handling" and maybe someone thought that it is bug reporting.
However, it's not related to Dev-C++ or user programming.
On the bug 1068471, someone complained about "&" keyword and, unfortunately, windows file system accept this symbol for the filename.
The filenames contained "&" char in their filename must have quotation mark before and after filename.
I guess the function, GetMakePath, should change like this
In the 743 in utils.pas file
{ GenMakePath: convert a filename to a format that can be
used by make }
function GenMakePath(FileName: String): String;
begin
Result:=StringReplace(Filename, '\', '/', [rfReplaceAll]);
if (Pos(' ', Filename)>0) or (Pos('&', Filename)>0) then
Result := '"'+Result+'"';
end;
To keep the consistency between GetMakePath and GetMakePath2, why don't you change GetMakePath2 to like this :
function GenMakePath2(FileName: String): String;
var
S: String;
begin
Result := '';
{ Convert backslashes to slashes }
S:=StringReplace(Filename, '\', '/', [rfReplaceAll]);
Result := StringReplace(S, ' ', '/ ', [rfReplaceAll]);
end;
or
function GenMakePath2(FileName: String): String;
begin
Result := '';
{ Convert backslashes to slashes }
Filename:=StringReplace(Filename, '\', '/', [rfReplaceAll]);
Result := StringReplace(Filename, ' ', '/ ', [rfReplaceAll]);
end;
If this is not right post on this forum, please leave a comment on this post.
Sorry if this message bothers you guys
Sorry. I wrote wrong replace code for ESCAPE SPACE.
function GenMakePath2(FileName: String): String;
begin
Result := '';
{ Convert backslashes to slashes }
Filename:=StringReplace(Filename, '\', '/', [rfReplaceAll]);
Result := StringReplace(Filename, ' ', '/ ', [rfReplaceAll]);
end;
To
function GenMakePath2(FileName: String): String;
begin
{ Convert backslashes to slashes }
Filename:=StringReplace(Filename, '\', '/', [rfReplaceAll]);
Result := StringReplace(Filename, ' ', '\ ', [rfReplaceAll]);
end;