From ec01b039797a9d694ffa5f9aed5fdfa521991479 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 5 Sep 2003 06:21:47 +0000 Subject: [PATCH] Use GetCwd(). --- stepmania/src/RageUtil_FileDB.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index 906e72e2c3..45c86f08bd 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -72,9 +72,8 @@ void FileSet::LoadFromDir(const CString &dir) } while( FindNextFile( hFind, &fd ) ); FindClose(hFind); #else - char buf[PATH_MAX]; - bool ret = getcwd(buf, PATH_MAX) != NULL; - ASSERT(ret); + CString OldDir = GetCwd(); + if( chdir(dir.c_str()) == -1 ) { /* Only log once per dir. */ @@ -111,7 +110,7 @@ void FileSet::LoadFromDir(const CString &dir) } closedir(d); - chdir(buf); + chdir( OldDir ); #endif }