Just found a string parsing bug in the new 'basedir.txt' functionality

for Win32.  This is going to be a 2.7.3a release just for Windows, as I'm
not recompiling everything just for one bug in the Windows code.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1674 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2009-02-09 15:50:59 +00:00
parent ada27762f5
commit b24de21ebc
2 changed files with 11 additions and 4 deletions

View File

@ -13,13 +13,13 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: Version.hxx,v 1.51 2009-02-07 21:50:05 stephena Exp $ // $Id: Version.hxx,v 1.52 2009-02-09 15:50:59 stephena Exp $
//============================================================================ //============================================================================
#ifndef VERSION_HXX #ifndef VERSION_HXX
#define VERSION_HXX #define VERSION_HXX
#define STELLA_BASE_VERSION "2.7.3" #define STELLA_BASE_VERSION "2.7.3a"
#ifdef NIGHTLY_BUILD #ifdef NIGHTLY_BUILD
#define STELLA_VERSION STELLA_BASE_VERSION "pre-" NIGHTLY_BUILD #define STELLA_VERSION STELLA_BASE_VERSION "pre-" NIGHTLY_BUILD

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: OSystemWin32.cxx,v 1.32 2009-01-30 23:31:41 stephena Exp $ // $Id: OSystemWin32.cxx,v 1.33 2009-02-09 15:50:59 stephena Exp $
//============================================================================ //============================================================================
#include "bspf.hxx" #include "bspf.hxx"
@ -47,8 +47,15 @@ OSystemWin32::OSystemWin32()
ifstream in(basedirfile.getPath().c_str()); ifstream in(basedirfile.getPath().c_str());
if(in && in.is_open()) if(in && in.is_open())
{ {
in >> basedir; getline(in, basedir);
in.close(); in.close();
// trim leading and trailing spaces
size_t spos = basedir.find_first_not_of(" \t");
size_t epos = basedir.find_last_not_of(" \t");
if(spos != string::npos && epos != string::npos)
basedir = basedir.substr(spos, epos-spos+1);
if(basedir != "") overrideBasedir = true; if(basedir != "") overrideBasedir = true;
} }
} }