Skip to content

Commit 20c2e32

Browse files
committed
fix(7z): remove redundant printf '%s\n' "..."
Only one element is specified to printf, so it just appends a newline. However, the newline is anyway removed by the word splitting performed by -W. We can safely remove the modifications by printf '%s\n'. Before commit 1d3add4, the argument specified to `printf` was not quoted so that each word splitted by IFS is printed to an independent line. However, as IFS is $'\n' in this context, words are obtained by splitting the result with newlines, so outputting them by printf '%s\n' does not have any effects. References: 1d3add4#diff-efd1d1be37bc3e0c0b77e1a2d9ef05a7d9d7a09262b710adca23db163b18f387
1 parent 34a91e9 commit 20c2e32

File tree

1 file changed

+2
-2
lines changed
  • completions

1 file changed

+2
-2
lines changed

completions/7z

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ _comp_cmd_7z()
102102
else
103103
if [[ ${words[1]} == d ]]; then
104104
local IFS=$'\n'
105-
COMPREPLY=($(compgen -W "$(printf '%s\n' "$("$1" l "${words[2]}" \
105+
COMPREPLY=($(compgen -W "$("$1" l "${words[2]}" \
106106
-slt 2>/dev/null | command sed -n '/^Path =/s/^Path = \(.*\)$/\1/p' \
107-
2>/dev/null | tail -n+2)")" -- "$cur"))
107+
2>/dev/null | tail -n+2)" -- "$cur"))
108108
compopt -o filenames
109109
else
110110
_comp_compgen_filedir

0 commit comments

Comments
 (0)