The following commit has been merged in the master branch:
commit a2de4aa132890b97dbe3ec028322562bc2e5b033
Author: Guillem Jover <[email protected]>
Date: Fri Feb 27 04:55:23 2009 +0200
libdpkg: Do nothing when parsing a boolean field with an empty string
The field should have been already initialized to 0 by
blankpackageperfile, so no need to assign again.
diff --git a/ChangeLog b/ChangeLog
index 19f5143..6e56018 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-02-27 Guillem Jover <[email protected]>
+
+ * lib/fields.c (f_boolean): Return if value is an empty string.
+
2009-02-26 Chris Coulson <[email protected]>,
Guillem Jover <[email protected]>
diff --git a/lib/fields.c b/lib/fields.c
index 31c9ae3..ce2b048 100644
--- a/lib/fields.c
+++ b/lib/fields.c
@@ -130,10 +130,10 @@ void f_boolean(struct pkginfo *pigp, struct
pkginfoperfile *pifp,
enum parsedbflags flags,
const char *filename, int lno, FILE *warnto, int *warncount,
const char *value, const struct fieldinfo *fip) {
- pifp->essential = *value ?
- convert_string(filename, lno, _("yes/no in boolean field"),
- -1, pigp, value, booleaninfos, NULL) :
- 0;
+ if (!*value)
+ return;
+ pifp->essential = convert_string(filename, lno, _("yes/no in boolean field"),
+ -1, pigp, value, booleaninfos, NULL);
}
void f_section(struct pkginfo *pigp, struct pkginfoperfile *pifp,
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]