summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moreau <oreaus@gmail.com>2009-11-19 21:30:37 -0700
committerScott Moreau <oreaus@gmail.com>2009-11-19 21:30:37 -0700
commit141c1d58fa3c7cdaeb7c8d53b2206c84177ca7fb (patch)
treecbf8f2ffdf038b32ec4e75806f85220324671887
parent4a8b66238ff2e688047efdbcad38eedc4e3589e8 (diff)
downloadstartup-141c1d58fa3c7cdaeb7c8d53b2206c84177ca7fb.tar.gz
startup-141c1d58fa3c7cdaeb7c8d53b2206c84177ca7fb.tar.bz2
Fix potential crash when loading with a blank list
-rw-r--r--src/startup.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/startup.cpp b/src/startup.cpp
index 56b118e..ca69a89 100644
--- a/src/startup.cpp
+++ b/src/startup.cpp
@@ -29,6 +29,9 @@ StartupScreen::RunCommands()
{
updateOptions();
+ if (numCommands < 1);
+ ranCommands = true;
+
for (int i = 0; i < numCommands; i++)
{
// FIXME: There may be a neater way to set this bool
@@ -187,8 +190,6 @@ StartupScreen::updateOptions ()
commands.clear ();
- numCommands = 0;
-
for (int i = 0; i < cPostStartupCommand.size (); i++, numCommands++)
{
commands.push_back (StartupCommand ());
@@ -217,6 +218,8 @@ StartupScreen::StartupScreen (CompScreen *screen) :
ranCommands = firstRun = firstSession = alreadyRunning = error = false;
+ numCommands = 0;
+
#define GET_ENV_VAR(ourvar, envvar, error) \
ourvar = getenv(#envvar); \
if ( ourvar == NULL ) \