diff options
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r-- | apt-pkg/contrib/configuration.cc | 15 | ||||
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 23 |
2 files changed, 20 insertions, 18 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index 27299ec6a..da026f0f6 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.9 1998/10/30 07:53:42 jgg Exp $ +// $Id: configuration.cc,v 1.10 1998/11/05 07:21:43 jgg Exp $ /* ###################################################################### Configuration Class @@ -292,8 +292,14 @@ bool ReadConfigFile(Configuration &Conf,string FName) } // Discard single line comments + bool InQuote = false; for (char *I = Buffer; *I != 0; I++) { + if (*I == '"') + InQuote = !InQuote; + if (InQuote == true) + continue; + if (*I == '/' && I[1] == '/') { *I = 0; @@ -304,6 +310,11 @@ bool ReadConfigFile(Configuration &Conf,string FName) // Look for multi line comments for (char *I = Buffer; *I != 0; I++) { + if (*I == '"') + InQuote = !InQuote; + if (InQuote == true) + continue; + if (*I == '/' && I[1] == '*') { InComment = true; @@ -398,7 +409,7 @@ bool ReadConfigFile(Configuration &Conf,string FName) string Word; if (ParseCWord(LineBuffer.c_str()+Pos,Word) == false) return _error->Error("Syntax error %s:%u: Malformed value",FName.c_str(),CurLine); - + // Generate the item name string Item; if (ParentTag.empty() == true) diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index c99f88c3f..d5f765dd4 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: strutl.cc,v 1.12 1998/11/04 07:11:13 jgg Exp $ +// $Id: strutl.cc,v 1.13 1998/11/05 07:21:44 jgg Exp $ /* ###################################################################### String Util - Some usefull string functions. @@ -623,23 +623,14 @@ void URI::CopyFrom(string U) for (; I < U.end() && *I != ':' ; I++); string::const_iterator FirstColon = I; - // Determine if this is a host type URI with a leading double // + /* Determine if this is a host type URI with a leading double // + and then search for the first single / */ string::const_iterator SingleSlash = I; if (I + 3 < U.end() && I[1] == '/' && I[2] == '/') - { - // Locate the single / that starts the path - for (; I < U.end(); I++) - { - if (*I == '/' && I+1 < U.end() && I[1] == '/') - I += 2; - else - if (*I == '/') - break; - } - if (I > U.end()) - I = U.end(); - SingleSlash = I; - } + SingleSlash += 3; + for (; SingleSlash < U.end() && *SingleSlash != '/'; SingleSlash++); + if (SingleSlash > U.end()) + SingleSlash = U.end(); // We can now write the access and path specifiers Access = string(U,0,FirstColon - U.begin()); |