diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-11-28 23:14:52 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-11-28 23:14:52 +0100 |
| commit | fa0bc075f4f3cfc841f4003914ce729820b09d22 (patch) | |
| tree | 570a99d2ff8cd4907818df3d1c4bfd61693d68d1 | |
| parent | f1d6b58cb9355ca655d5365505b1f725a89808c6 (diff) | |
| download | tuxcmd-fa0bc075f4f3cfc841f4003914ce729820b09d22.tar.xz | |
Set allowed path delimiters to a forward slash only
This is a workaround for FPC RTL bug, a declination from Borland standards.
It will allow us to have directories ending with a backslash.
| -rw-r--r-- | UCoreUtils.pas | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/UCoreUtils.pas b/UCoreUtils.pas index 203fbc7..f319d44 100644 --- a/UCoreUtils.pas +++ b/UCoreUtils.pas @@ -1590,7 +1590,7 @@ var bytes_read, bytes_written: gsize; m: PChar; begin if g_utf8_validate(s, strlen(s), nil) then begin - Result := strndup(s, strlen(s)); + Result := strdup(s); Exit; end; // DebugMsg(['StrToUTF8: string "', s, '" is not valid UTF-8.']); @@ -1869,6 +1869,12 @@ end; initialization +{$IFDEF FPC} + // Set path separators only to a standard Unix slash -- otherwise all path functions will treat ending backslash as a delimiter, + // causing problems with directory names ending with a backslash (it's a valid character in Unix). + // Kylix behaves fine, only forward slash is honored. + AllowDirectorySeparators := ['/']; +{$ENDIF} InternalLockInit(True); SetupSignals; |
