aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-05-17 20:50:46 (GMT)
committermarkt <markt>2007-05-17 20:50:46 (GMT)
commit49aae21402262156a5f6497dc29ac777a268ea2b (patch)
treeb294d133bdb74852c05b3bdacd6feb65b2938c94
parentf4eb5aeb3d484d8fded7b45fd20b7d1853e7a289 (diff)
downloadfluxbox-49aae21402262156a5f6497dc29ac777a268ea2b.zip
fluxbox-49aae21402262156a5f6497dc29ac777a268ea2b.tar.bz2
make sure included file is valid before saving it
-rw-r--r--src/MenuCreator.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc
index d973a66..a04860f 100644
--- a/src/MenuCreator.cc
+++ b/src/MenuCreator.cc
@@ -466,7 +466,6 @@ FbTk::Menu *MenuCreator::createFromFile(const string &filename, int screen_numbe
466bool MenuCreator::createFromFile(const string &filename, 466bool MenuCreator::createFromFile(const string &filename,
467 FbTk::Menu &inject_into, bool require_begin) { 467 FbTk::Menu &inject_into, bool require_begin) {
468 string real_filename = FbTk::StringUtil::expandFilename(filename); 468 string real_filename = FbTk::StringUtil::expandFilename(filename);
469 Fluxbox::instance()->saveMenuFilename(real_filename.c_str());
470 469
471 FbMenuParser parser(real_filename); 470 FbMenuParser parser(real_filename);
472 if (!parser.isLoaded()) 471 if (!parser.isLoaded())
@@ -476,6 +475,9 @@ bool MenuCreator::createFromFile(const string &filename,
476 if (require_begin && !getStart(parser, label, m_stringconvertor)) 475 if (require_begin && !getStart(parser, label, m_stringconvertor))
477 return false; 476 return false;
478 477
478 // save menu filename, so we can check if it changes
479 Fluxbox::instance()->saveMenuFilename(real_filename.c_str());
480
479 startFile(); 481 startFile();
480 parseMenu(parser, inject_into, m_stringconvertor); 482 parseMenu(parser, inject_into, m_stringconvertor);
481 endFile(); 483 endFile();