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

Merge branch 'sid' (through tag '1.16.0.3')

Conflicts:
	debian/changelog
Guillem Jover лет назад: 15
Родитель
Сommit
cbde7fa861
2 измененных файлов с 16 добавлено и 4 удалено
  1. 7 0
      debian/changelog
  2. 9 4
      lib/dpkg/fields.c

+ 7 - 0
debian/changelog

@@ -63,6 +63,13 @@ dpkg (1.16.1) UNRELEASED; urgency=low
 
  -- Raphaël Hertzog <hertzog@debian.org>  Sat, 02 Apr 2011 09:21:26 +0200
 
+dpkg (1.16.0.3) unstable; urgency=medium
+
+  * Allow again Priority field values not known to dpkg. Regression
+    introduced in 1.16.0.
+
+ -- Guillem Jover <guillem@debian.org>  Wed, 04 May 2011 10:01:30 +0200
+
 dpkg (1.16.0.2) unstable; urgency=high
 
   * Fix dpkg-split --auto to not fail when opening the new depot file.

+ 9 - 4
lib/dpkg/fields.c

@@ -48,9 +48,14 @@ parse_nv_next(struct parsedb_state *ps, const struct pkginfo *pigp,
   if (nv == NULL)
     parse_error(ps, pigp, _("'%.50s' is not allowed for %s"), str_start, what);
 
-  str_end = str_start + nv->length;
-  while (isspace(str_end[0]))
-    str_end++;
+  /* We got the fallback value, skip further string validation. */
+  if (nv->length == 0) {
+    str_end = NULL;
+  } else {
+    str_end = str_start + nv->length;
+    while (isspace(str_end[0]))
+      str_end++;
+  }
   *strp = str_end;
 
   return nv->value;
@@ -64,7 +69,7 @@ parse_nv_last(struct parsedb_state *ps, const struct pkginfo *pkg,
   int value;
 
   value = parse_nv_next(ps, pkg, what, nv_head, &str);
-  if (str[0] != '\0')
+  if (str != NULL && str[0] != '\0')
     parse_error(ps, pkg, _("junk after %s"), what);
 
   return value;