Forráskód Böngészése

* check zero length instead of comparing to empty string

Michael VAN CANNEYT 2 éve
szülő
commit
1911b300cf
1 módosított fájl, 10 hozzáadás és 10 törlés
  1. 10 10
      rtl/inc/system.inc

+ 10 - 10
rtl/inc/system.inc

@@ -1714,7 +1714,7 @@ end;
 Procedure SysAssert(Const Msg,FName:Shortstring;LineNo:Longint;ErrorAddr:Pointer);
 begin
 {$ifdef FPC_HAS_FEATURE_CONSOLEIO}
-  If msg='' then
+  If Length(msg)=0 then
     write(stderr,'Assertion failed')
   else
     write(stderr,msg);
@@ -2012,7 +2012,7 @@ end;
 
 Procedure MkDir(Const s: RawByteString);[IOCheck];
 Begin
-  If (s='') or (InOutRes <> 0) then
+  If (Length(s)=0) or (InOutRes <> 0) then
    exit;
 {$ifdef FPCRTL_FILESYSTEM_SINGLE_BYTE_API}
   Do_mkdir(ToSingleByteFileSystemEncodedFileName(S));
@@ -2024,7 +2024,7 @@ end;
 
 Procedure RmDir(Const s: RawByteString);[IOCheck];
 Begin
-  If (s='') or (InOutRes <> 0) then
+  If (Length(s)=0) or (InOutRes <> 0) then
    exit;
 {$ifdef FPCRTL_FILESYSTEM_SINGLE_BYTE_API}
   Do_rmdir(ToSingleByteFileSystemEncodedFileName(S));
@@ -2036,7 +2036,7 @@ End;
 
 Procedure ChDir(Const s: RawByteString);[IOCheck];
 Begin
-  If (s='') or (InOutRes <> 0) then
+  If (Length(s)=0) or (InOutRes <> 0) then
    exit;
 {$ifdef FPCRTL_FILESYSTEM_SINGLE_BYTE_API}
   Do_chdir(ToSingleByteFileSystemEncodedFileName(S));
@@ -2073,7 +2073,7 @@ end;
 
 Procedure MkDir(Const s: shortstring);[IOCheck];
 Begin
-  If (s='') or (InOutRes <> 0) then
+  If (Length(s)=0) or (InOutRes <> 0) then
    exit;
   Do_mkdir(GetDirStrFromShortstring(S));
 End;
@@ -2081,7 +2081,7 @@ End;
 
 Procedure RmDir(Const s: shortstring);[IOCheck];
 Begin
-  If (s='') or (InOutRes <> 0) then
+  If (Length(s)=0) or (InOutRes <> 0) then
    exit;
   Do_rmdir(GetDirStrFromShortstring(S));
 End;
@@ -2089,7 +2089,7 @@ End;
 
 Procedure ChDir(Const s: shortstring);[IOCheck];
 Begin
-  If (s='') or (InOutRes <> 0) then
+  If (Length(S)=0) or (InOutRes <> 0) then
    exit;
   Do_chdir(GetDirStrFromShortstring(S));
 End;
@@ -2142,7 +2142,7 @@ end;
 
 Procedure MkDir(Const s: UnicodeString);[IOCheck];
 Begin
-  if (s='') or (InOutRes <> 0) then
+  if (Length(s)=0) or (InOutRes <> 0) then
    exit;
   Do_mkdir(S);
 End;
@@ -2150,7 +2150,7 @@ End;
 
 Procedure RmDir(Const s: UnicodeString);[IOCheck];
 Begin
-  if (s='') or (InOutRes <> 0) then
+  if (Length(s)=0) or (InOutRes <> 0) then
    exit;
   Do_rmdir(S);
 End;
@@ -2158,7 +2158,7 @@ End;
 
 Procedure ChDir(Const s: UnicodeString);[IOCheck];
 Begin
-  if (s='') or (InOutRes <> 0) then
+  if (Length(s)=0) or (InOutRes <> 0) then
    exit;
   Do_chdir(S);
 End;