[fpc-devel]Ok. It's my configuration problem.

KO Myung-Hun komh at chollian.net
Mon Oct 23 16:11:48 CEST 2000


Hi/2 all.

All what Hajny said are correct. Problem is there in my configuration.

But configuration is PATH environment not PPC386.CFG. Before, Jonas said

that tools for FPC must be in first 255 chars of PATH. I forgot it.

Path for emx binary is 255 chars later in PATH. By correcting it, I

could get correct result.

But, I still have a question. Apparently, I set 'search for tools'

options to correct emx binary path with -FD option in PPC386.CFG.

Nevertheless, FPC do not recognize emx binaries. Why ? FPC do not use

-FD argument internally ?

And Hajny's saying about DosCalls.PAS also correct. I'm sorry. ^^;

Finally, I fixed fexpand function in dos.pas. Below is fixed fexpand

source.

--------
function fexpand(const path:pathstr):pathstr;

    function get_current_drive:byte;assembler;

    asm
        movb $0x19,%ah
        call syscall
    end;

var s,pa:string;
    i,j:longint;

begin
    getdir(0,s);
    if FileNameCaseSensitive then
        pa := path
    else
        pa:=upcase(path);
    {Allow slash as backslash}
    for i:=1 to length(pa) do
        if pa[i]='/' then
            pa[i]:='\';
    if (length(pa)>1) and (pa[1] in ['A'..'Z']) and (pa[2]=':') then
        begin
            {We must get the right directory}
            getdir(byte(pa[1])-byte('A')+1,s);
(* ---------------- fix start. *)
           if pa[ 0 ] = #2 then
                pa := s
            else
            if (byte(pa[0])>2) and (pa[3]<>'\') then
                if pa[1]=s[1] then
                begin
                    if s[ 0 ] = #3 then
                        Dec( s[ 0 ]);

                    pa:=s+'\'+copy (pa,3,length(pa))
                end
                else
                    pa:=pa[1]+':\'+copy (pa,3,length(pa))
(*----------------- fix end. *)
        end
    else
        if pa[1]='\' then
            pa:=s[1]+':'+pa
        else if s[0]=#3 then
            pa:=s+pa
        else
            pa:=s+'\'+pa;
    {First remove all references to '\.\'}
    i:=pos('\.\',pa);
    while i<>0 do
        begin
            delete(pa,i,2);
            i:=pos('\.\',pa);
        end;
    {Now remove also all references to '\..\' + of course previous
dirs..}
    repeat
        i:=pos('\..\',pa);
        if i<>0 then
            begin
                j:=i-1;
                while (j>1) and (pa[j]<>'\') do
                    dec(j);
                delete (pa,j,i-j+3);
            end;
    until i=0;

(* removed routine for end . and \ *)

    fexpand:=pa;
end;
-------

This fix bugs below.

    - if path is 'x:dir' and 'x:\' is current dir,
      then return value is 'x:\\dir'

    - if pa is 'x:\', then return value is 'x:'

    - removed routine for end '.' and '\',
      because BP 7.0 does not so.

For the better FPC !!!

    from KO Myung-Hun...






More information about the fpc-devel mailing list