Skip to content

ls: long mode format needs additional space when security or FACL symbol is present.#9913

Open
sgmarz wants to merge 3 commits intouutils:mainfrom
sgmarz:ls_cl_padding
Open

ls: long mode format needs additional space when security or FACL symbol is present.#9913
sgmarz wants to merge 3 commits intouutils:mainfrom
sgmarz:ls_cl_padding

Conversation

@sgmarz
Copy link

@sgmarz sgmarz commented Dec 29, 2025

The following PR fixes issue #9912.

There is now an added else statement in src/uu/ls/src/ls.rs if neither the security context nor FACL symbols are present to add two spaces instead of just one.

This patch is minimally invasive, however the testing suite was also updated to allow for the . or + symbols as well as a space. Simply, the regex in test_ls.rs was changed from [.+]? to [.+ ]?.

With this PR, the columns now line up properly even when the security context (.) or FACL symbols (+) are present or mixed as demonstrated below:

~> ls_cl_padding/coreutils ls -laF
total 4
drwxr-xr-x   1 root root   34 Dec 29 13:33 ./
drwxr-xr-x  20 root root 4096 Dec 26 12:57 ../
-rw-r--r--   1 root root    0 Dec 29 13:33 abc
drwxrwxr-x+  1 root root  302 Dec 22 20:36 cbin/
-rw-r--r--   1 root root    0 Dec 29 13:33 def
-rw-r--r--   1 root root    0 Dec 29 13:33 ghi
drwxrwxr-x+  1 root root   98 Dec 28 05:54 http/

@sylvestre
Copy link
Contributor

sorry, it needs to be rebased

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants