secureswitools/swisistools/source/sisxlibrary/utility.cpp
changeset 60 245df5276b97
parent 0 ba25891c3a9e
--- a/secureswitools/swisistools/source/sisxlibrary/utility.cpp	Tue Jul 06 14:23:31 2010 +0300
+++ b/secureswitools/swisistools/source/sisxlibrary/utility.cpp	Wed Aug 18 09:55:45 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of the License "Eclipse Public License v1.0"
@@ -48,7 +48,7 @@
 	}
 
 
-std::string wstring2string (const std::wstring& aWide)
+DllExport std::string wstring2string (const std::wstring& aWide)
 	{
 	int max = ConvertWideCharToMultiByte(aWide.c_str(),aWide.length(),0,0);
 	std::string reply;
@@ -84,8 +84,8 @@
 			{
 			}
 		delete [] buffer;
-		}
-	return reply;
+		}	
+	return reply.c_str();
 	}
 
 void EnsureExtended (std::wstring& aName, const std::wstring& aDefaultExtension)
@@ -380,9 +380,16 @@
     int len = 0;
 	while(len = FirstInvalidDirSeparatorSize(ret, idx))
         {
-		ret.replace( idx, len, KSisDirectorySeparator );
+		if(idx == 0 && len == 2)
+			{
+			ret.replace( idx, len, KSisInitialNetworkPathSlashes );
+			}
+		else
+			{
+			ret.replace( idx, len, KSisDirectorySeparator );
+			}
         }
-    return ret;
+    return ret.c_str();
     }
 
 int GetFileType(std::wstring& aFileName)