Skip to contentSkip to conversation

device-mapper ./WHATS_NEW lib/libdm-report.c

PATCH [email protected] 1 participant 1 message Apr 27, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/dm
Module name: device-mapper
Changes by: [email protected] 2007-04-27 16:22:27

Modified files:
. : WHATS_NEW
lib : libdm-report.c

Log message:
Avoid trailing separator in reports when there are hidden sort fields.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/WHATS_NEW.diff?cvsroot=dm&r1=1.178&r2=1.179
http://sourceware.org/cgi-bin/cvsweb.cgi/device-mapper/lib/libdm-report.c.diff?cvsroot=dm&r1=1.13&r2=1.14

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 1.02.19 -
 ====================================
+  Avoid trailing separator in reports when there are hidden sort fields.
   Fix segfault in 'dmsetup status' without --showkeys against crypt target.
   Deal with some more compiler warnings.
   Introduce _add_field() and _is_same_field() to libdm-report.c.
lib/libdm-report.c +9 -1
@@ -316,7 +316,15 @@
 	}
 
 	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;
 }