]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsblk: use strcoll() to sort
authorKarel Zak <kzak@redhat.com>
Thu, 1 Sep 2022 09:05:20 +0000 (11:05 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 1 Sep 2022 09:12:13 +0000 (11:12 +0200)
It's more user-friendly to follow locale.

Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/src/cell.c

index 4cd6e59811be9f108d15df1f868b20b5051feed3..ca2a2b6394ed9d5fedc6ae9b1e0afe57503d1751 100644 (file)
@@ -129,10 +129,10 @@ void *scols_cell_get_userdata(struct libscols_cell *ce)
  * @b: pointer to cell
  * @data: unused pointer to private data (defined by API)
  *
- * Compares cells data by strcmp(). The function is designed for
+ * Compares cells data by strcoll(). The function is designed for
  * scols_column_set_cmpfunc() and scols_sort_table().
  *
- * Returns: follows strcmp() return values.
+ * Returns: follows strcoll() return values.
  */
 int scols_cmpstr_cells(struct libscols_cell *a,
                       struct libscols_cell *b,
@@ -152,7 +152,7 @@ int scols_cmpstr_cells(struct libscols_cell *a,
                return -1;
        if (bdata == NULL)
                return 1;
-       return strcmp(adata, bdata);
+       return strcoll(adata, bdata);
 }
 
 /**