From f07ece1dc8ba40156be450f13a43635ab195806a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 6 Apr 2004 04:22:18 +0000 Subject: [PATCH] fix assertion on song paths starting with lots of "../" --- stepmania/src/Song.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stepmania/src/Song.cpp b/stepmania/src/Song.cpp index 3ab171875f..ea5bac7343 100644 --- a/stepmania/src/Song.cpp +++ b/stepmania/src/Song.cpp @@ -458,6 +458,11 @@ void FixupPath( CString &path, const CString &sSongPath ) CollapsePath( path ); + /* If the path still begins with "../", then there were an unreasonable number + * of them at the beginning of the path. Clear the path entirely. */ + if( path.Left(3) == "../" ) + path = ""; + /* Many imported files contain erroneous whitespace before or after * filenames. Paths usually don't actually start or end with spaces, * so let's just remove it. */