// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: configuration.cc,v 1.11 1999/01/18 06:20:07 jgg Exp $
+// $Id: configuration.cc,v 1.13 1999/07/02 23:17:00 jgg Exp $
/* ######################################################################
Configuration Class
#endif
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
-#include <strutl.h>
+#include <apt-pkg/strutl.h>
#include <stdio.h>
#include <fstream.h>
char Buffer[300];
string LineBuffer;
+ string Stack[100];
+ unsigned int StackPos = 0;
// Parser state
string ParentTag;
// 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
// Go down a level
if (TermChar == '{')
{
+ if (StackPos <= 100)
+ Stack[StackPos++] = ParentTag;
if (ParentTag.empty() == true)
ParentTag = Tag;
else