From: Andre Noll Date: Fri, 28 Aug 2015 20:33:57 +0000 (+0200) Subject: lsatt: Fix sort order. X-Git-Tag: v0.5.5~10^2 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=70f1a837efe7307b4162a63b470599100f9c4703 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. --- 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);