summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:08 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:08 +0000
commita4e87467fe5c5d12a617a43f3115c89daa54b7cf (patch)
treecfe83ef0c54e441f4f02bb9a697440c23c60e3ba
parentfbdccabb17963090e21e3b02bc72dda68f34d524 (diff)
downloadapt-a4e87467fe5c5d12a617a43f3115c89daa54b7cf.tar.gz
Fixed a bug with deep sub sections..
Author: jgg Date: 1999-07-02 23:17:00 GMT Fixed a bug with deep sub sections..
-rw-r--r--apt-pkg/contrib/configuration.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc
index e702c26e..1c58b988 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.12 1999/01/27 02:48:52 jgg Exp $
+// $Id: configuration.cc,v 1.13 1999/07/02 23:17:00 jgg Exp $
/* ######################################################################
Configuration Class
@@ -276,6 +276,8 @@ bool ReadConfigFile(Configuration &Conf,string FName)
char Buffer[300];
string LineBuffer;
+ string Stack[100];
+ unsigned int StackPos = 0;
// Parser state
string ParentTag;
@@ -376,11 +378,10 @@ bool ReadConfigFile(Configuration &Conf,string FName)
// Move up a tag
if (TermChar == '}')
{
- string::size_type Pos = ParentTag.rfind("::");
- if (Pos == string::npos)
+ if (StackPos == 0)
ParentTag = string();
else
- ParentTag = string(ParentTag,0,Pos);
+ ParentTag = Stack[--StackPos];
}
// Syntax Error
@@ -399,6 +400,8 @@ bool ReadConfigFile(Configuration &Conf,string FName)
// Go down a level
if (TermChar == '{')
{
+ if (StackPos <= 100)
+ Stack[StackPos++] = ParentTag;
if (ParentTag.empty() == true)
ParentTag = Tag;
else