X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=inline;f=ETL%2Ftrunk%2FETL%2F_stringf.h;h=d26645332204aa912cd68c1b805cf56d321a3b59;hb=2dd185d5a236d7d610fc9c4fda81011ce5e9386b;hp=61621acef972f804b42c6a208c48be04526b3826;hpb=aefba09c3c4e8f1165663162c77a030dc5b7af56;p=synfig.git diff --git a/ETL/trunk/ETL/_stringf.h b/ETL/trunk/ETL/_stringf.h index 61621ac..d266453 100644 --- a/ETL/trunk/ETL/_stringf.h +++ b/ETL/trunk/ETL/_stringf.h @@ -53,11 +53,7 @@ _ETL_BEGIN_CDECLS #else # ifdef HAVE_VSNPRINTF // This is the secondary method -# if defined(__CYGWIN__) || defined(_WIN32) -extern int vsnprintf(char *,unsigned int,const char*,va_list)ETL_NO_THROW; -# else -extern int vsnprintf(char *,int,const char*,va_list)ETL_NO_THROW; -# endif + extern int vsnprintf(char *,size_t,const char*,va_list)ETL_NO_THROW; # endif #endif @@ -199,12 +195,10 @@ is_absolute_path(const std::string &path) #ifdef WIN32 if(path.size()>=3 && path[1]==':' && (path[2]=='\\' || path[2]=='/')) return true; - return false; -#else +#endif if(!path.empty() && path[0]==ETL_DIRECTORY_SEPERATOR) return true; return false; -#endif } inline std::string @@ -278,11 +272,11 @@ cleanup_path(std::string path) while(!path.empty()) { std::string dir(get_root_from_path(path)); - if(dir=="../" && ret.size()) + if((dir=="../" || dir=="..\\") && ret.size()) { ret=dirname(ret)+ETL_DIRECTORY_SEPERATOR; } - else if(dir!="./" && dir!=".") + else if((dir!="./" && dir!=".\\") && dir!=".") { ret+=dir; } @@ -347,7 +341,7 @@ relative_path(std::string curr_path,std::string dest_path) while(!curr_path.empty()) { - dest_path="../"+dest_path; + dest_path=std::string("..")+ETL_DIRECTORY_SEPERATOR+dest_path; curr_path=remove_root_from_path(curr_path); }