diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/fields.c | 8 |
2 files changed, 11 insertions, 2 deletions
@@ -1,5 +1,10 @@ 2009-02-27 Guillem Jover <guillem@debian.org> + * lib/fields.c (f_boolean): Use PKGPFIELD to assign to the correct + member instead of hardcoding to the essential member. + +2009-02-27 Guillem Jover <guillem@debian.org> + * lib/fields.c (f_boolean): Return if value is an empty string. 2009-02-26 Chris Coulson <chrisccoulson@googlemail.com>, diff --git a/lib/fields.c b/lib/fields.c index ce2b04846..0d32d274c 100644 --- a/lib/fields.c +++ b/lib/fields.c @@ -130,10 +130,14 @@ 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) { + int boolean; + if (!*value) return; - pifp->essential = convert_string(filename, lno, _("yes/no in boolean field"), - -1, pigp, value, booleaninfos, NULL); + + boolean = convert_string(filename, lno, _("yes/no in boolean field"), + -1, pigp, value, booleaninfos, NULL); + PKGPFIELD(pifp, fip->integer, int) = boolean; } void f_section(struct pkginfo *pigp, struct pkginfoperfile *pifp, |