From 01b70479a0ec5911460d35520b6984bf83d52135 Mon Sep 17 00:00:00 2001 From: Michael VAN CANNEYT Date: Fri, 6 Jan 2023 11:55:40 +0100 Subject: [PATCH] * string -> shortstring, check zero length instead of comparing to empty string --- rtl/inc/isotmp.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rtl/inc/isotmp.inc b/rtl/inc/isotmp.inc index c286672c15..4d8376bb57 100644 --- a/rtl/inc/isotmp.inc +++ b/rtl/inc/isotmp.inc @@ -24,7 +24,7 @@ unique : Boolean; begin InternalChangeCase := S; - if InternalChangeCase = '' then + if Length(InternalChangeCase) then exit; unique := false; p := PWideChar(InternalChangeCase); @@ -74,12 +74,12 @@ FreeEnvironmentStringsW(p); end; - function getTempDir: String; + function getTempDir: ShortString; var astringLength : Integer; begin getTempDir := GetEnvironmentVariable('TMP'); - if getTempDir = '' then + if Length(getTempDir)=0 then getTempDir := GetEnvironmentVariable('TEMP'); astringlength := Length(getTempDir); if (astringlength > 0) and (getTempDir[astringlength] <> DirectorySeparator) then @@ -90,10 +90,10 @@ {$ELSEIF defined(UNIX) and not defined(android)} - function getTempDir: string; + function getTempDir: shortstring; var - key: string; - value: string; + key: shortstring; + value: shortstring; i_env, i_key, i_value: integer; begin value := '/tmp/'; (** default for UNIX **) @@ -130,7 +130,7 @@ {$ELSE} // neither unix nor windows - function getTempDir: string; + function getTempDir: shortstring; begin getTempDir:=''; end;