From: Ketmar Dark Date: Sat, 2 Nov 2019 06:06:27 +0000 (+0200) Subject: utils: game: backslash is windoze-specific path separator X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=b4b66ea803f8d896c2b2abd75108ef233030da03;p=d2df-sdl.git utils: game: backslash is windoze-specific path separator --- diff --git a/src/game/g_main.pas b/src/game/g_main.pas index 050ee1f..9fadc1b 100644 --- a/src/game/g_main.pas +++ b/src/game/g_main.pas @@ -139,7 +139,11 @@ procedure InitPath; function IsSep (ch: Char): Boolean; begin - result := (ch = '/') or (ch = '\') + {$IFDEF WINDOWS} + result := (ch = '/') or (ch = '\'); + {$ELSE} + result := (ch = '/'); + {$ENDIF} end; function OptimizePath (dir: AnsiString): AnsiString; diff --git a/src/shared/utils.pas b/src/shared/utils.pas index 14fa53b..790feb7 100644 --- a/src/shared/utils.pas +++ b/src/shared/utils.pas @@ -342,11 +342,15 @@ end; // ////////////////////////////////////////////////////////////////////////// // // rewrites slashes to '/' function fixSlashes (s: AnsiString): AnsiString; +{$IFDEF WINDOWS} var f: Integer; +{$ENDIF} begin result := s; + {$IFDEF WINDOWS} for f := 1 to length(result) do if (result[f] = '\') then result[f] := '/'; + {$ENDIF} end;