diff --git a/rtl/inc/fexpand.inc b/rtl/inc/fexpand.inc index 43be3ebe37..4cd4664c4c 100644 --- a/rtl/inc/fexpand.inc +++ b/rtl/inc/fexpand.inc @@ -161,7 +161,7 @@ begin S := GetEnv ('HOME'); {$ENDIF FPC_FEXPAND_GETENV_PCHAR} {$ENDIF FPC_FEXPAND_SYSUTILS} - if (S = '') or (Length (S) = 1) + if (S = '') or (Length (S) = 1) and (Length (Pa) > 1) and (S [1] = DirectorySeparator) then Delete (Pa, 1, 1) else