X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=kernel%2Fsrc%2FbbtkUtilities.cxx;h=7c02a604027393f9c4075cde07bd0f05c530a2ec;hb=1688b52778caa9985ecea38aad38341817e0401a;hp=7f8ed76c1e9bcd6a384edc3af0e72710cc03b07e;hpb=d9a9ad1dfc4015176c8e6220b56f9246e112fd87;p=bbtk.git diff --git a/kernel/src/bbtkUtilities.cxx b/kernel/src/bbtkUtilities.cxx index 7f8ed76..7c02a60 100644 --- a/kernel/src/bbtkUtilities.cxx +++ b/kernel/src/bbtkUtilities.cxx @@ -2,8 +2,8 @@ Program: bbtk Module: $RCSfile: bbtkUtilities.cxx,v $ Language: C++ - Date: $Date: 2009/01/28 11:54:04 $ - Version: $Revision: 1.12 $ + 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"; @@ -279,11 +280,15 @@ namespace bbtk #endif #elif defined(_WIN32) - if (c != '\\') - libname = path+"\\bb"; + if (c != '\\') + libname += "\\bb"; + else + libname += "bb"; libname += pkgname; libname += ".dll"; #endif + } + return libname; } @@ -292,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; } // =======================================================================