From 10448486647a4f046373057458dd9a1e5ebaa6ad Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 12 Jul 2008 19:23:44 +0000 Subject: [PATCH] fix broken symlinks causing warnings --- stepmania/src/RageFileDriverDirectHelpers.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stepmania/src/RageFileDriverDirectHelpers.cpp b/stepmania/src/RageFileDriverDirectHelpers.cpp index 3f9051fdcf..91f4a33880 100644 --- a/stepmania/src/RageFileDriverDirectHelpers.cpp +++ b/stepmania/src/RageFileDriverDirectHelpers.cpp @@ -265,13 +265,14 @@ void DirectFilenameDB::PopulateFileSet( FileSet &fs, const RString &path ) struct stat st; if( DoStat(root+sPath + "/" + pEnt->d_name, &st) == -1 ) { + int iError = errno; /* If it's a broken symlink, ignore it. Otherwise, warn. */ - if( lstat(pEnt->d_name, &st) == 0 ) + if( lstat(root+sPath + "/" + pEnt->d_name, &st) == 0 ) continue; /* Huh? */ WARN( ssprintf("Got file '%s' in '%s' from list, but can't stat? (%s)", - pEnt->d_name, sPath.c_str(), strerror(errno)) ); + pEnt->d_name, sPath.c_str(), strerror(iError)) ); continue; } else