Author: aschnell
Date: Fri Jul 25 13:22:13 2008
New Revision: 49415
URL: http://svn.opensuse.org/viewcvs/yast?rev=49415&view=rev
Log:
- use tokenizer
Modified:
trunk/storage/libstorage/src/Md.cc
Modified: trunk/storage/libstorage/src/Md.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Md.cc?rev=49415&r1=49414&r2=49415&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Md.cc (original)
+++ trunk/storage/libstorage/src/Md.cc Fri Jul 25 13:22:13 2008
@@ -4,6 +4,7 @@
#include <sstream>
#include
+#include
#include "y2storage/Md.h"
#include "y2storage/StorageTypes.h"
@@ -249,7 +250,7 @@
void
Md::getState(MdStateInfo& info) const
{
- SystemCmd c("mdadm --detail " + device());
+ SystemCmd c("mdadm --detail " + SystemCmd::quote(device()));
c.select("State : ");
if( c.retcode()==0 && c.numLines(true)>0 )
@@ -259,14 +260,14 @@
if( (pos=state.find( "State : " ))!=string::npos )
state.erase( 0, pos+8 );
- list<string> entries;
- boost::split(entries, state, boost::is_any_of(","));
+ typedef boost::tokenizer char_tokenizer;
+ char_tokenizer toker(state, boost::char_separator<char>(","));
info.active = false;
info.degraded = false;
- for (list<string>::const_iterator i = entries.begin(); i != entries.end(); i++)
+ for (char_tokenizer::const_iterator it = toker.begin(); it != toker.end(); it++)
{
- string s = boost::trim_copy(*i, locale::classic());
+ string s = boost::trim_copy(*it, locale::classic());
if (s == "active")
info.active = true;
else if (s == "degraded")
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org