]> Creatis software - bbtk.git/blobdiff - kernel/src/bbtkUtilities.cxx
Works with visual studio 2009
[bbtk.git] / kernel / src / bbtkUtilities.cxx
index eeaabe5841649423d99f3e2e3ddbcf79df704b87..7c02a604027393f9c4075cde07bd0f05c530a2ec 100644 (file)
@@ -2,8 +2,8 @@
   Program:   bbtk
   Module:    $RCSfile: bbtkUtilities.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/01/29 08:45:29 $
-  Version:   $Revision: 1.13 $
+  Date:      $Date: 2009/10/05 22:44:48 $
+  Version:   $Revision: 1.14 $
 =========================================================================*/
 
 /* ---------------------------------------------------------------------
@@ -265,7 +265,8 @@ namespace bbtk
   std::string Utilities::MakeLibnameFromPath(std::string path, std::string pkgname)
   {
     std::string libname = path;
-    char c = path[path.size()-1];    
+       if(path.size()>0){
+               char c = path[path.size()-1];    
 #if defined(__GNUC__)
        if (c != '/')
           libname += "/libbb";
@@ -286,6 +287,8 @@ namespace bbtk
        libname += pkgname;
        libname += ".dll";
 #endif
+       }
+    
     return libname;    
   }
 
@@ -294,23 +297,26 @@ namespace bbtk
   std::string Utilities::MakePkgnameFromPath(std::string path, std::string pkgname, bool addExt)
   {
     std::string libname = path;
-    char c = path[path.size()-1];
-    if (c != '/' && c != '\\')
-    {
-       libname +=  ConfigurationFile::GetInstance().Get_file_separator ();
-    }
-    libname += pkgname;
-    if (addExt)
-    {
-       int l = libname.size();
-       if (l>4)
-       {
-          if (libname.substr(l-4, 4) != ".bbs")
-          {
-               libname = libname + ".bbs";
-          }
-       }
-    }
+       if(path.size()>0){
+               char c = path[path.size()-1];
+               if (c != '/' && c != '\\')
+               {
+                  libname +=  ConfigurationFile::GetInstance().Get_file_separator ();
+               }
+               libname += pkgname;
+               if (addExt)
+               {
+                  int l = libname.size();
+                  if (l>4)
+                  {
+                         if (libname.substr(l-4, 4) != ".bbs")
+                         {
+                                  libname = libname + ".bbs";
+                         }
+                  }
+               }
+       }
+    
     return libname;
   }
   // =======================================================================