summaryrefslogtreecommitdiff
path: root/UCoreUtils.pas
diff options
context:
space:
mode:
Diffstat (limited to 'UCoreUtils.pas')
-rw-r--r--UCoreUtils.pas8
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;