diff --git a/packages/fcl-registry/src/winreg.inc b/packages/fcl-registry/src/winreg.inc index 63c51d6e8a..cc5fc37607 100644 --- a/packages/fcl-registry/src/winreg.inc +++ b/packages/fcl-registry/src/winreg.inc @@ -31,10 +31,9 @@ end; Function PrepKey(Const S : String) : String; begin - If Copy(S, 1, 1)='\' then - Result := Copy(Result, 2) - else - Result := S; + Result := S; + if (Result <> '') and (Result[1] = '\') then + System.Delete(Result, 1, 1); end; Function RelativeKey(Const S : String) : Boolean;