From 75ebbc865f9d84a31a97b4dbd2e9434bc15b6335 Mon Sep 17 00:00:00 2001 From: Hubert Maier Date: Fri, 11 Oct 2019 21:50:52 +0200 Subject: AMIGAOS4: Fix positioning of workaround Otherwise both dos.library and it's interface will remain open in the rare (?) occasion of p.size <= 0,--- backends/fs/amigaos4/amigaos4-fs.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'backends') diff --git a/backends/fs/amigaos4/amigaos4-fs.cpp b/backends/fs/amigaos4/amigaos4-fs.cpp index c6261cf39d..7657bf20c0 100644 --- a/backends/fs/amigaos4/amigaos4-fs.cpp +++ b/backends/fs/amigaos4/amigaos4-fs.cpp @@ -69,6 +69,15 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode() { AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) { ENTER(); + int offset = p.size(); + + //assert(offset > 0); + + if (offset <= 0) { + debug(6, "Bad offset"); + return; + } + // WORKAROUND: // This is a bug in AmigaOS4 newlib.library 53.30 and lower. // It will be removed once a fixed version is available to public. @@ -80,15 +89,6 @@ AmigaOSFilesystemNode::AmigaOSFilesystemNode(const Common::String &p) { // than one engine/(shared) plugin is available. DOSBase = IExec->OpenLibrary("dos.library", 0); IDOS = (struct DOSIFace *)IExec->GetInterface(DOSBase, "main", 1, NULL); - - int offset = p.size(); - - //assert(offset > 0); - - if (offset <= 0) { - debug(6, "Bad offset"); - return; - } _sPath = p; _sDisplayName = ::lastPathComponent(_sPath); -- cgit v1.2.3