mirror of
https://github.com/dlang/phobos.git
synced 2025-05-07 19:49:36 +03:00
Merge pull request #4494 from WalterBright/file-delete
std.file: delete is not @safe
This commit is contained in:
commit
b54a972424
1 changed files with 5 additions and 1 deletions
|
@ -358,7 +358,11 @@ version (Windows) private void[] readImpl(const(char)[] name, const(FSChar)* nam
|
|||
cenforce(trustedGetFileSize(h, fileSize), name, namez);
|
||||
size_t size = min(upTo, fileSize);
|
||||
auto buf = uninitializedArray!(ubyte[])(size);
|
||||
scope(failure) delete buf;
|
||||
|
||||
scope(failure)
|
||||
{
|
||||
() @trusted { delete buf; } ();
|
||||
}
|
||||
|
||||
cenforce(trustedReadFile(h, buf.ptr, size), name, namez);
|
||||
return buf[0 .. size];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue