X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/8d99802677287a86759232898199db40add923fd..d73e594e888fbc099bba84726df72eedcee5272c:/apt-pkg/contrib/configuration.cc diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index 56eb374c6..740aa8137 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.26 2003/07/25 20:45:13 mdz Exp $ +// $Id: configuration.cc,v 1.28 2004/04/30 04:00:15 mdz Exp $ /* ###################################################################### Configuration Class @@ -392,7 +392,7 @@ bool Configuration::ExistsAny(const char *Name) const } else { - _error->Warning("Unrecognized type abbreviation: '%c'", key.end()[-3]); + _error->Warning(_("Unrecognized type abbreviation: '%c'"), key.end()[-3]); } return Exists(Name); @@ -452,7 +452,7 @@ bool ReadConfigFile(Configuration &Conf,string FName,bool AsSectional, if (!F != 0) return _error->Errno("ifstream::ifstream",_("Opening configuration file %s"),FName.c_str()); - char Buffer[300]; + char Buffer[1024]; string LineBuffer; string Stack[100]; unsigned int StackPos = 0; @@ -466,6 +466,10 @@ bool ReadConfigFile(Configuration &Conf,string FName,bool AsSectional, { F.getline(Buffer,sizeof(Buffer)); CurLine++; + // This should be made to work instead, but this is better than looping + if (F.fail() && !F.eof()) + return _error->Error(_("Line %d too long (max %d)"), CurLine, sizeof(Buffer)); + _strtabexpand(Buffer,sizeof(Buffer)); _strstrip(Buffer);