Author: aschnell
Date: Thu May 14 17:51:59 2009
New Revision: 57186
URL: http://svn.opensuse.org/viewcvs/yast?rev=57186&view=rev
Log:
- use boost function
Modified:
trunk/storage/libstorage/src/Nfs.cc
Modified: trunk/storage/libstorage/src/Nfs.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Nfs.cc?rev=57186&r1=57185&r2=57186&view=diff
==============================================================================
--- trunk/storage/libstorage/src/Nfs.cc (original)
+++ trunk/storage/libstorage/src/Nfs.cc Thu May 14 17:51:59 2009
@@ -4,8 +4,6 @@
#include <sstream>
-#include
-
#include "y2storage/Nfs.h"
#include "y2storage/StorageTypes.h"
#include "y2storage/Container.h"
@@ -60,19 +58,19 @@
setFs(NFS);
}
-string Nfs::canonicalName( const string& d )
+
+ string
+ Nfs::canonicalName(const string& d)
{
- string dev(d);
- string::size_type pos = 0;
- while( (pos=dev.find("//",pos))!=string::npos )
- dev.erase(pos,1);
- if( !dev.empty() && *dev.rbegin()=='/' )
- dev.erase(dev.size()-1);
- if( dev!=d )
- y2mil( "dev:" << dev << " d:" << d );
- return(dev);
+ string dev = boost::replace_all_copy(d, "//", "/");
+ if (!dev.empty() && *dev.rbegin() == '/')
+ dev.erase(dev.size() - 1);
+ if (dev != d)
+ y2mil("dev:" << dev << " d:" << d);
+ return dev;
}
+
void Nfs::getInfo( NfsInfo& tinfo ) const
{
((Volume*)this)->getInfo( info.v );
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org