[fpc-devel] FExpand function

Joao Morais post at joaomorais.com.br
Sat Mar 4 22:05:39 CET 2006


Hello,

Should this comparison (!) be fixed? Seeing that this code is going to 
be changed, what about change Pa[I] assignment from a variable to a 
constant?

<<rtl/inc/fexpand.inc>>

  (* Allow both '/' and '\' as directory separators *)
  (* by converting all to the native one.           *)
      if DirectorySeparator = '\' then
      {Allow slash as backslash}
        begin
          for I := 1 to Length (Pa) do
            if Pa [I] = '/' then
              Pa [I] := DirectorySeparator
        end
      else
!      if DirectorySeparator = '\' then
      {Allow backslash as slash}
          begin
            for I := 1 to Length (Pa) do
              if Pa [I] = '\' then
                Pa [I] := DirectorySeparator;
          end;

Thanks,
--
Joao Morais



More information about the fpc-devel mailing list