mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 21:09:24 +02:00
* do not call mkdir with trailing directory separator and do not silently ignore errors in MkDir
git-svn-id: trunk@28816 -
This commit is contained in:
parent
f33c59376a
commit
8adacb096e
@ -358,7 +358,8 @@ end;
|
||||
|
||||
procedure mkdirtree(const s:string);
|
||||
var
|
||||
hs : string;
|
||||
SErr, hs : string;
|
||||
Err: longint;
|
||||
begin
|
||||
if s='' then
|
||||
exit;
|
||||
@ -371,11 +372,16 @@ begin
|
||||
{ Try parent first }
|
||||
mkdirtree(SplitPath(hs));
|
||||
{ make this dir }
|
||||
Verbose(V_Debug,'Making Directory '+s);
|
||||
Verbose(V_Debug,'Making directory '+s);
|
||||
{$I-}
|
||||
mkdir(s);
|
||||
MkDir (HS);
|
||||
{$I+}
|
||||
ioresult;
|
||||
Err := IOResult;
|
||||
if Err <> 0 then
|
||||
begin
|
||||
Str (Err, SErr);
|
||||
Verbose (V_Error, 'Directory creation failed ' + SErr);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user