From 4a112dd3f8fb8c4f27bae88493e79c6d26f5be3a Mon Sep 17 00:00:00 2001 From: Paul Richards Date: Wed, 25 Jan 1995 07:56:10 +0000 Subject: [PATCH] More parser fixes. Store attributes properly for each field and don't emit a second declaration unless it's different to the default. --- usr.bin/fib/parser.y | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/usr.bin/fib/parser.y b/usr.bin/fib/parser.y index 2b3615f6847d..d7c10fa4467e 100644 --- a/usr.bin/fib/parser.y +++ b/usr.bin/fib/parser.y @@ -610,7 +610,7 @@ parse_form(struct form_list *form, FILE *outf) } else { fields->field.type = def->field.type; fields->field.width = def->field.width; - fields->field.attr = def->field.attr; + fields->attr = def->attr; } if (!links) { @@ -621,15 +621,16 @@ parse_form(struct form_list *form, FILE *outf) fields->field.right = -1; fields->field.next = -1; fields->defname = fieldname; - } else { + } + + if (strcmp(def->fieldname, fields->fieldname)) output_field(def, fields->fieldname, outf); - if ((fields->field.type == F_TEXT) - || (fields->field.type == F_ACTION)) - fields->defname = def->fieldname; - else - fields->defname = fields->fieldname; - } + if ((fields->field.type == F_TEXT) + || (fields->field.type == F_ACTION)) + fields->defname = def->fieldname; + else + fields->defname = fields->fieldname; } /* Output the field table for this form */