// ---------------------------------------------------------------------
/* This is used in decoding the 256bit encoded fixed length fields in
tar files */
-bool Base256ToNum(const char *Str,unsigned long &Res,unsigned Len)
+bool Base256ToNum(const char *Str,unsigned long &Res,unsigned int Len)
{
- int i;
if ((Str[0] & 0x80) == 0)
return false;
else
{
Res = Str[0] & 0x7F;
- for(i=1; i<Len; i++)
+ for(unsigned int i = 1; i < Len; ++i)
Res = (Res<<8) + Str[i];
return true;
}
return Buffer + Did;
}
/*}}}*/
+// StripEpoch - Remove the version "epoch" from a version string /*{{{*/
+// ---------------------------------------------------------------------
+string StripEpoch(const string &VerStr)
+{
+ size_t i = VerStr.find(":");
+ if (i == string::npos)
+ return VerStr;
+ return VerStr.substr(i+1);
+}
// tolower_ascii - tolower() function that ignores the locale /*{{{*/
// ---------------------------------------------------------------------