1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-05 19:21:59 +01:00

(bug 137)

Make DirManager::MoveToNewProjectDirectory(), DirManager::CopyToNewProjectDirectory(), and several BuildFromXML() methods check the result of AssignFile() and do something appropriate about it on failure, rather than ignoring it. Also made AssignFile() check whether the assigned name is well-formed, so it doesn't always return TRUE when disckcheck is FALSE.

Briefer and more correct checks for uninitialized wxFileName objects.

Several "//ANSWER-ME" comments about file ops and commented-out cruft to probably remove.

Clarify some logic and readability.
This commit is contained in:
v.audacity
2010-08-31 23:31:11 +00:00
parent fb296d0206
commit 1c5ba68d55
5 changed files with 68 additions and 46 deletions

View File

@@ -207,7 +207,11 @@ BlockFile *PCMAliasBlockFile::BuildFromXML(DirManager &dm, const wxChar **attrs)
&& (strValue.Length() + 1 + dm.GetProjectDataDir().Length() <= MAX_PATH)
#endif
)
dm.AssignFile(summaryFileName, strValue, false);
{
if (!dm.AssignFile(summaryFileName, strValue, false))
// Make sure summaryFileName is back to uninitialized state so we can detect problem later.
summaryFileName.Clear();
}
else if (!wxStricmp(attr, wxT("aliasfile")))
{
if (XMLValueChecker::IsGoodPathName(strValue))