]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
findmnt: properly exclude poll columns from --output-all
authorThomas Weißschuh <thomas@t-8ch.de>
Thu, 27 Jan 2022 17:00:12 +0000 (18:00 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Thu, 27 Jan 2022 17:04:37 +0000 (18:04 +0100)
Previously columns excluded from --output-all where in fact stored as
column index 0. This however is COL_ACTION which is a polled column
leading to the following error:

findmnt --output-all
findmnt: ACTION column is requested, but --poll is not enabled

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
misc-utils/findmnt.c

index 1c19d608b4e05faf2c3d4062531d706d8c2a4a19..80263d3d73ca83f05ca25da66f061a63701b9575 100644 (file)
@@ -1492,10 +1492,11 @@ int main(int argc, char *argv[])
                        outarg = optarg;
                        break;
                case FINDMNT_OPT_OUTPUT_ALL:
-                       for (ncolumns = 0; ncolumns < ARRAY_SIZE(infos); ncolumns++) {
-                               if (is_tabdiff_column(ncolumns))
+                       ncolumns = 0;
+                       for (int i = 0; i < ARRAY_SIZE(infos); i++) {
+                               if (is_tabdiff_column(i))
                                        continue;
-                               columns[ncolumns] = ncolumns;
+                               columns[ncolumns++] = i;
                        }
                        break;
                case 'O':