Просмотр исходного кода

Don't die if lines in sources.list are too long. Closes...
Author: jgg
Date: 2002-07-08 04:18:07 GMT
Don't die if lines in sources.list are too long. Closes: #146846

Arch Librarian лет назад: 22
Родитель
Сommit
ba1045b415
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      apt-pkg/sourcelist.cc

+ 5 - 2
apt-pkg/sourcelist.cc

@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
 // Description								/*{{{*/
-// $Id: sourcelist.cc,v 1.23 2002/07/01 21:41:11 jgg Exp $
+// $Id: sourcelist.cc,v 1.24 2002/07/08 04:18:07 jgg Exp $
 /* ######################################################################
 /* ######################################################################
 
 
    List of Sources
    List of Sources
@@ -245,7 +245,10 @@ bool pkgSourceList::Read(string File)
       F.getline(Buffer,sizeof(Buffer));
       F.getline(Buffer,sizeof(Buffer));
       CurLine++;
       CurLine++;
       _strtabexpand(Buffer,sizeof(Buffer));
       _strtabexpand(Buffer,sizeof(Buffer));
-      
+      if (F.fail() && !F.eof())
+	 return _error->Error(_("Line %u too long in source list %s."),
+			      CurLine,File.c_str());
+
       
       
       char *I;
       char *I;
       for (I = Buffer; *I != 0 && *I != '#'; I++);
       for (I = Buffer; *I != 0 && *I != '#'; I++);