Cosmetics

This commit is contained in:
Olivier Teulière 2011-08-28 16:33:50 +02:00
parent d6fbd6bef1
commit 3d48facb55
6 changed files with 4 additions and 17 deletions

View file

@ -21,6 +21,7 @@
#include "config.h"
#include <boost/format.hpp>
#include <getopt.h>
#include <string>
#include <fstream>
@ -153,9 +154,7 @@ Game *GameFactory::createFromCmdLine(int argc, char **argv)
wstring name;
if (optarg == NULL)
{
// TODO: use Boost.Format
char s[200];
snprintf(s, 200, _("Player %u"), m_players.size() + 1);
string s = str(boost::format(_("Player %1%")) % (m_players.size() + 1));
name = wfl(s);
}
else

View file

@ -199,6 +199,7 @@ void XmlWriter::write(const Game &iGame, const string &iFileName)
}
else
{
LOG_ERROR("Unsupported command: " << lfw(cmd->toString()));
// XXX
//throw SaveGameException("Unsupported command: " + lfw(cmd->toString()));
}

View file

@ -105,10 +105,6 @@ load_game 0
load_saved_game 0 # randseed unused
# save and load a game combining 2 variants
load_combi_variants 21
# load a training game with advanced format (test.elt)
# load_test_adv 0 # We need to specify a much more complete file format
# before we can handle load/save on duplicate and
# freegame games
#####################
# Regular Expression

View file

@ -1,7 +0,0 @@
c test.elt
a p
a g
a l
q
q

View file

@ -1,2 +0,0 @@
[?] pour l'aide
commande> c test.elt

View file

@ -179,7 +179,7 @@ wstring checkFileNameToken(const vector<wstring> &tokens, uint8_t index)
const wstring &wstr = tokens[index];
BOOST_FOREACH(wchar_t wch, wstr)
{
if (!iswalpha(wch) && wch != L'.' && wch != L'_')
if (!iswalnum(wch) && wch != L'.' && wch != L'_')
return L"";
}
return wstr;