Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6017


Ignore:
Timestamp:
Nov 2, 2009, 11:42:16 PM (15 years ago)
Author:
rgrieder
Message:

Fix in Shell: No string in outputLines_ should contain '\n'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/console/src/libraries/core/Shell.cc

    r6010 r6017  
    3131#include "util/OutputHandler.h"
    3232#include "util/StringUtils.h"
     33#include "util/SubString.h"
    3334#include "CommandExecutor.h"
    3435#include "CoreIncludes.h"
     
    192193    void Shell::addOutputLine(const std::string& line, int level)
    193194    {
    194         if (level <= this->softDebugLevel_)
    195             this->outputLines_.push_front(line);
    196         this->updateListeners<&ShellListener::lineAdded>();
     195        // Make sure we really only have one line per line (no new lines!)
     196        SubString lines(line, '\n');
     197        for (unsigned i = 0; i < lines.size(); ++i)
     198        {
     199            if (level <= this->softDebugLevel_)
     200                this->outputLines_.push_front(lines[i]);
     201            this->updateListeners<&ShellListener::lineAdded>();
     202        }
    197203    }
    198204
Note: See TracChangeset for help on using the changeset viewer.