From 70f1a837efe7307b4162a63b470599100f9c4703 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Fri, 28 Aug 2015 22:33:57 +0200 Subject: [PATCH] lsatt: Fix sort order. The -i option had the opposite effect of what the documentation says. That is, lsatt -i sorted the attribute list by name while the default was to sort by id. This patch reverts the logic in com_lsatt() to let the implementation match the documentation. --- attribute.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/attribute.c b/attribute.c index 96b54c99..5672309a 100644 --- a/attribute.c +++ b/attribute.c @@ -162,7 +162,7 @@ static void com_lsatt_callback(int fd, const struct osl_object *query) }; struct pattern_match_data pmd = { .table = attribute_table, - .loop_col_num = ATTCOL_BITNUM, + .loop_col_num = ATTCOL_NAME, .match_col_num = ATTCOL_NAME, .patterns = {.data = (char *)query->data + sizeof(laad.flags), .size = query->size - sizeof(laad.flags)}, @@ -171,7 +171,7 @@ static void com_lsatt_callback(int fd, const struct osl_object *query) .action = print_attribute }; if (laad.flags & LSATT_FLAG_SORT_BY_ID) - pmd.loop_col_num = ATTCOL_NAME; + pmd.loop_col_num = ATTCOL_BITNUM; if (laad.flags & LSATT_FLAG_REVERSE) pmd.pm_flags |= PM_REVERSE_LOOP; for_each_matching_row(&pmd); -- 2.39.5