diff options
author | Alasdair Kergon <agk@redhat.com> | 2007-04-27 15:22:27 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2007-04-27 15:22:27 +0000 |
commit | af998ff6c2aa0c125293e3766208407dda9bb855 (patch) | |
tree | 62a8df826bb63b45537604ed9582008364b9487d /libdm/libdm-report.c | |
parent | d59b2474e1d7c14e1c6d2074bc779e1310dd348c (diff) | |
download | lvm2-af998ff6c2aa0c125293e3766208407dda9bb855.tar.gz lvm2-af998ff6c2aa0c125293e3766208407dda9bb855.tar.xz lvm2-af998ff6c2aa0c125293e3766208407dda9bb855.zip |
Avoid trailing separator in reports when there are hidden sort fields.
Diffstat (limited to 'libdm/libdm-report.c')
-rw-r--r-- | libdm/libdm-report.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index 1423872c..1bff8385 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -316,7 +316,15 @@ static struct field_properties * _add_field(struct dm_report *rh, } fp->flags |= flags; - list_add(&rh->field_props, &fp->list); + + /* + * Place hidden fields at the front so list_end() will + * tell us when we've reached the last visible field. + */ + if (fp->flags & FLD_HIDDEN) + list_add_h(&rh->field_props, &fp->list); + else + list_add(&rh->field_props, &fp->list); return fp; } |