* chdir,mkdir,rmdir with empty string fixed

This commit is contained in:
peter 2001-02-20 21:31:12 +00:00
parent 3b7b4ab99c
commit bcbb21839d
4 changed files with 45 additions and 26 deletions

View File

@ -1237,7 +1237,7 @@ end;
procedure mkdir(const s : string);[IOCheck]; procedure mkdir(const s : string);[IOCheck];
begin begin
If InOutRes <> 0 then If (s='') or (InOutRes <> 0) then
exit; exit;
DosDir($39,s); DosDir($39,s);
end; end;
@ -1245,7 +1245,7 @@ end;
procedure rmdir(const s : string);[IOCheck]; procedure rmdir(const s : string);[IOCheck];
begin begin
If InOutRes <> 0 then If (s='') or (InOutRes <> 0) then
exit; exit;
DosDir($3a,s); DosDir($3a,s);
end; end;
@ -1255,7 +1255,7 @@ procedure chdir(const s : string);[IOCheck];
var var
regs : trealregs; regs : trealregs;
begin begin
If InOutRes <> 0 then If (s='') or (InOutRes <> 0) then
exit; exit;
{ First handle Drive changes } { First handle Drive changes }
if (length(s)>=2) and (s[2]=':') then if (length(s)>=2) and (s[2]=':') then
@ -1417,7 +1417,10 @@ Begin
End. End.
{ {
$Log$ $Log$
Revision 1.3 2000-08-13 19:23:26 peter Revision 1.4 2001-02-20 21:31:12 peter
* chdir,mkdir,rmdir with empty string fixed
Revision 1.3 2000/08/13 19:23:26 peter
* fixed double declared ___exit() (merged) * fixed double declared ___exit() (merged)
Revision 1.2 2000/07/13 11:33:40 michael Revision 1.2 2000/07/13 11:33:40 michael

View File

@ -689,7 +689,8 @@ end;
procedure MkDir (const S: string); procedure MkDir (const S: string);
begin begin
if InOutRes = 0 then If (s='') or (InOutRes <> 0) then
exit;
DosDir ($39, S); DosDir ($39, S);
end; end;
@ -697,7 +698,8 @@ end;
procedure rmdir(const s : string); procedure rmdir(const s : string);
begin begin
if InOutRes = 0 then If (s='') or (InOutRes <> 0) then
exit;
DosDir ($3A, S); DosDir ($3A, S);
end; end;
@ -709,8 +711,8 @@ var RC: longint;
Buffer: array [0..255] of char; Buffer: array [0..255] of char;
begin begin
if InOutRes = 0 then If (s='') or (InOutRes <> 0) then
begin exit;
(* According to EMX documentation, EMX has only one current directory (* According to EMX documentation, EMX has only one current directory
for all processes, so we'll use native calls under OS/2. *) for all processes, so we'll use native calls under OS/2. *)
if os_Mode = osOS2 then if os_Mode = osOS2 then
@ -765,7 +767,6 @@ begin
end end
else else
DosDir ($3B, S); DosDir ($3B, S);
end;
end; end;
{$ASMMODE ATT} {$ASMMODE ATT}
@ -948,7 +949,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.7 2001-02-04 01:57:52 hajny Revision 1.8 2001-02-20 21:31:12 peter
* chdir,mkdir,rmdir with empty string fixed
Revision 1.7 2001/02/04 01:57:52 hajny
* direct asm removing * direct asm removing
Revision 1.6 2001/02/01 21:30:01 hajny Revision 1.6 2001/02/01 21:30:01 hajny

View File

@ -447,7 +447,8 @@ Procedure MkDir(Const s: String);[IOCheck];
Var Var
Buffer: Array[0..255] of Char; Buffer: Array[0..255] of Char;
Begin Begin
If InOutRes <> 0 then exit; If (s='') or (InOutRes <> 0) then
exit;
Move(s[1], Buffer, Length(s)); Move(s[1], Buffer, Length(s));
Buffer[Length(s)] := #0; Buffer[Length(s)] := #0;
sys_mkdir(@buffer, 511); sys_mkdir(@buffer, 511);
@ -459,7 +460,8 @@ Procedure RmDir(Const s: String);[IOCheck];
Var Var
Buffer: Array[0..255] of Char; Buffer: Array[0..255] of Char;
Begin Begin
If InOutRes <> 0 then exit; If (s='') or (InOutRes <> 0) then
exit;
Move(s[1], Buffer, Length(s)); Move(s[1], Buffer, Length(s));
Buffer[Length(s)] := #0; Buffer[Length(s)] := #0;
sys_rmdir(@buffer); sys_rmdir(@buffer);
@ -471,7 +473,8 @@ Procedure ChDir(Const s: String);[IOCheck];
Var Var
Buffer: Array[0..255] of Char; Buffer: Array[0..255] of Char;
Begin Begin
If InOutRes <> 0 then exit; If (s='') or (InOutRes <> 0) then
exit;
Move(s[1], Buffer, Length(s)); Move(s[1], Buffer, Length(s));
Buffer[Length(s)] := #0; Buffer[Length(s)] := #0;
sys_chdir(@buffer); sys_chdir(@buffer);
@ -743,7 +746,10 @@ End.
{ {
$Log$ $Log$
Revision 1.4 2000-12-17 14:00:57 peter Revision 1.5 2001-02-20 21:31:12 peter
* chdir,mkdir,rmdir with empty string fixed
Revision 1.4 2000/12/17 14:00:57 peter
* removed debug writelns * removed debug writelns
Revision 1.3 2000/10/09 16:35:51 marco Revision 1.3 2000/10/09 16:35:51 marco

View File

@ -615,27 +615,30 @@ begin
end; end;
function CreateDirectoryTrunc(name:pointer):word; function CreateDirectoryTrunc(name:pointer):word;
begin begin
CreateDirectoryTrunc:=CreateDirectory(name,nil); CreateDirectoryTrunc:=CreateDirectory(name,nil);
end; end;
procedure mkdir(const s:string);[IOCHECK]; procedure mkdir(const s:string);[IOCHECK];
begin begin
If InOutRes <> 0 then exit; If (s='') or (InOutRes <> 0) then
exit;
dirfn(TDirFnType(@CreateDirectoryTrunc),s); dirfn(TDirFnType(@CreateDirectoryTrunc),s);
end; end;
procedure rmdir(const s:string);[IOCHECK]; procedure rmdir(const s:string);[IOCHECK];
begin begin
If InOutRes <> 0 then exit; If (s='') or (InOutRes <> 0) then
exit;
dirfn(TDirFnType(@RemoveDirectory),s); dirfn(TDirFnType(@RemoveDirectory),s);
end; end;
procedure chdir(const s:string);[IOCHECK]; procedure chdir(const s:string);[IOCHECK];
begin begin
If InOutRes <> 0 then exit; If (s='') or (InOutRes <> 0) then
exit;
dirfn(TDirFnType(@SetCurrentDirectory),s); dirfn(TDirFnType(@SetCurrentDirectory),s);
end; end;
procedure getdir(drivenr:byte;var dir:shortstring); procedure getdir(drivenr:byte;var dir:shortstring);
const const
@ -1423,7 +1426,10 @@ end.
{ {
$Log$ $Log$
Revision 1.5 2001-01-26 16:38:03 florian Revision 1.6 2001-02-20 21:31:12 peter
* chdir,mkdir,rmdir with empty string fixed
Revision 1.5 2001/01/26 16:38:03 florian
*** empty log message *** *** empty log message ***
Revision 1.4 2001/01/24 21:47:38 florian Revision 1.4 2001/01/24 21:47:38 florian