From 71314d484c585f19e14ec9456d5cd27b853e8a3c Mon Sep 17 00:00:00 2001 From: "giantpune@gmail.com" Date: Sat, 11 Dec 2010 11:05:37 +0000 Subject: [PATCH] * fix bug in nandBin class that added the "/" root item to the path being extracted to git-svn-id: http://wiiqt.googlecode.com/svn/trunk@17 389f4c8b-5dfe-645f-db0e-df882bc27289 --- WiiQt/nandbin.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/WiiQt/nandbin.cpp b/WiiQt/nandbin.cpp index cd39ac4..452deee 100755 --- a/WiiQt/nandbin.cpp +++ b/WiiQt/nandbin.cpp @@ -160,11 +160,15 @@ bool NandBin::ExtractDir( fst_t fst, QString parent ) QByteArray ba( (char*)fst.filename, 0xc ); QString filename( ba ); - QFileInfo fi( parent + "/" + filename ); - if( filename != "/" && !fi.exists() && !QDir().mkpath( fi.absoluteFilePath() ) ) + QFileInfo fi( parent ); + if( filename != "/" ) { - emit SendError( tr( "Can\'t create directory \"%1\"" ).arg( fi.absoluteFilePath() ) ); - return false; + fi.setFile( parent + "/" + filename ); + if( !fi.exists() && !QDir().mkpath( fi.absoluteFilePath() ) ) + { + emit SendError( tr( "Can\'t create directory \"%1\"" ).arg( fi.absoluteFilePath() ) ); + return false; + } } if( fst.sub != 0xffff && !ExtractFST( fst.sub, fi.absoluteFilePath() ) )