summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-12-21 13:26:33 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2007-12-21 13:26:33 +0100
commit6ad4feb6e2c4dc7badfdfd57c0110d58567d7a7a (patch)
tree8c0487dcbdf4563aefe40afc2cc2b71e3a6e7e56 /apt-pkg/contrib
parent8076139ead08124e86be5f993baa8a43c22b0137 (diff)
parentf00d26304c1febd47d5d9aefdcb9dd7e25f4058c (diff)
merged with mvo branch
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/configuration.cc7
-rw-r--r--apt-pkg/contrib/strutl.cc6
2 files changed, 9 insertions, 4 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc
index 3109fd7a5..e8301d918 100644
--- a/apt-pkg/contrib/configuration.cc
+++ b/apt-pkg/contrib/configuration.cc
@@ -173,6 +173,11 @@ string Configuration::Find(const char *Name,const char *Default) const
*/
string Configuration::FindFile(const char *Name,const char *Default) const
{
+ const Item *RootItem = Lookup("RootDir");
+ std::string rootDir = (RootItem == 0) ? "" : RootItem->Value;
+ if(rootDir.size() > 0 && rootDir[rootDir.size() - 1] != '/')
+ rootDir.push_back('/');
+
const Item *Itm = Lookup(Name);
if (Itm == 0 || Itm->Value.empty() == true)
{
@@ -204,7 +209,7 @@ string Configuration::FindFile(const char *Name,const char *Default) const
Itm = Itm->Parent;
}
- return val;
+ return rootDir + val;
}
/*}}}*/
// Configuration::FindDir - Find a directory name /*{{{*/
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index 006452af4..a04c266ba 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -331,19 +331,19 @@ string TimeToStr(unsigned long Sec)
{
if (Sec > 60*60*24)
{
- sprintf(S,"%lid %lih%lim%lis",Sec/60/60/24,(Sec/60/60) % 24,(Sec/60) % 60,Sec % 60);
+ sprintf(S,"%lid %lih%limin%lis",Sec/60/60/24,(Sec/60/60) % 24,(Sec/60) % 60,Sec % 60);
break;
}
if (Sec > 60*60)
{
- sprintf(S,"%lih%lim%lis",Sec/60/60,(Sec/60) % 60,Sec % 60);
+ sprintf(S,"%lih%limin%lis",Sec/60/60,(Sec/60) % 60,Sec % 60);
break;
}
if (Sec > 60)
{
- sprintf(S,"%lim%lis",Sec/60,Sec % 60);
+ sprintf(S,"%limin%lis",Sec/60,Sec % 60);
break;
}