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

Fix field-without-values appearing at end of file.

Jay Freeman (saurik) лет назад: 9
Родитель
Сommit
4f1e54bea1
1 измененных файлов с 1 добавлено и 3 удалено
  1. 1 3
      apt-pkg/tagfile.cc

+ 1 - 3
apt-pkg/tagfile.cc

@@ -276,10 +276,8 @@ bool pkgTagSection::Scan(const char *Start,unsigned long MaxLength,bool const Su
 	 // find the beginning of the value
 	 // find the beginning of the value
 	 Stop = Colon + 1;
 	 Stop = Colon + 1;
 	 for (; Stop < End && isspace_ascii(*Stop) != 0; ++Stop)
 	 for (; Stop < End && isspace_ascii(*Stop) != 0; ++Stop)
-	    if (*Stop == '\n' && Stop[1] != ' ')
+	    if (*Stop == '\n' && (Stop+1 == End || Stop[1] != ' '))
 	       break;
 	       break;
-	 if (Stop >= End)
-	    return false;
 	 lastTagData.StartValue = Stop - Section;
 	 lastTagData.StartValue = Stop - Section;
       }
       }