summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpaul <paul@FreeBSD.org>1995-02-01 04:08:19 +0000
committerpaul <paul@FreeBSD.org>1995-02-01 04:08:19 +0000
commit41f11011a18c7fe095dbde567f4a1c3f1b8cf75e (patch)
treed200dd223c65b3b8e88511d7b99c5dc10aa2737c
parent0305d2ddc1bf66ecafae556f714242e7c8a04664 (diff)
downloadFreeBSD-src-41f11011a18c7fe095dbde567f4a1c3f1b8cf75e.zip
FreeBSD-src-41f11011a18c7fe095dbde567f4a1c3f1b8cf75e.tar.gz
Fix calculation of default field heights and a bug in the setting
of form dimensions.
-rw-r--r--usr.bin/fib/parser.y13
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/fib/parser.y b/usr.bin/fib/parser.y
index dc07490..f450b9e 100644
--- a/usr.bin/fib/parser.y
+++ b/usr.bin/fib/parser.y
@@ -258,7 +258,7 @@ a_color: BLACK
forms: FORM NAME
{ formname = cpstr($2); }
- AT coord LBRACE formspec RBRACE
+ AT coord
{
form = malloc(sizeof (struct form_list));
if (!form) {
@@ -267,6 +267,9 @@ forms: FORM NAME
}
form->form.y = y;
form->form.x = x;
+ }
+ LBRACE formspec RBRACE
+ {
form->startfield = startname;
form->formname = formname;
form->colortable = colortable;
@@ -750,13 +753,13 @@ calc_field_height(struct field *field, char *string)
len = strlen(string);
- if (!width) {
+ if (!field->width) {
/*
* This is a failsafe, this routine shouldn't be called
* with a width of 0, the width should be determined
* first.
*/
- height = 1;
+ field->height = 1;
return;
}
@@ -764,9 +767,9 @@ calc_field_height(struct field *field, char *string)
field->height = 1;
return;
} else
- field->height = len / width;
+ field->height = len / field->width;
- if ((field->height*width) < len)
+ if ((field->height*field->width) < len)
field->height++;
return;
OpenPOWER on IntegriCloud