summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/configuration.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:51:01 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:51:01 +0000
commit0a8e3465cb644e380ab0fc6d66f6d1f17363b34e (patch)
tree7bc1f7814b793e616fb516d130e26bae04f848cf /apt-pkg/contrib/configuration.cc
parente1b74f61dfb6980d643cb7c666c761ff3bda2f1e (diff)
Sync
Author: jgg Date: 1998-10-02 04:39:42 GMT Sync
Diffstat (limited to 'apt-pkg/contrib/configuration.cc')
-rw-r--r--apt-pkg/contrib/configuration.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc
index b12fed6be..433b92244 100644
--- a/apt-pkg/contrib/configuration.cc
+++ b/apt-pkg/contrib/configuration.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: configuration.cc,v 1.5 1998/09/26 05:34:26 jgg Exp $
+// $Id: configuration.cc,v 1.6 1998/10/02 04:39:49 jgg Exp $
/* ######################################################################
Configuration Class
@@ -105,6 +105,7 @@ string Configuration::Find(const char *Name,const char *Default)
// Configuration::FindDir - Find a directory /*{{{*/
// ---------------------------------------------------------------------
/* Directories are stored as the base dir in the Parent node and the
+ sub directory in sub nodes
*/
string Configuration::FindDir(const char *Name,const char *Default = 0)
{
@@ -117,8 +118,16 @@ string Configuration::FindDir(const char *Name,const char *Default = 0)
return Default;
}
+ // Absolute path
if (Itm->Value[0] == '/' || Itm->Parent == 0)
return Itm->Value;
+
+ // ./ is also considered absolute as is anything with ~ in it
+ if (Itm->Value[0] != 0 &&
+ ((Itm->Value[0] == '.' && Itm->Value[1] == '/') ||
+ (Itm->Value[0] == '~' && Itm->Value[1] == '/')))
+ return Itm->Value;
+
if (Itm->Parent->Value.end()[-1] == '/')
return Itm->Parent->Value + Itm->Value;
else
@@ -167,7 +176,7 @@ bool Configuration::FindB(const char *Name,bool Default)
strcasecmp(Itm->Value.c_str(),"true") == 0 ||
strcasecmp(Itm->Value.c_str(),"with") == 0 ||
strcasecmp(Itm->Value.c_str(),"enable") == 0)
- return false;
+ return true;
return Default;
}