From 838cc05fcecf1962ce724f5b1b894d4a6e2998bb Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 26 Nov 2015 18:38:18 +1300 Subject: Fix/flesh out the comments a bit --- bash/bashrc.d/man.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bash') diff --git a/bash/bashrc.d/man.bash b/bash/bashrc.d/man.bash index 4e656887..8a6df3ea 100644 --- a/bash/bashrc.d/man.bash +++ b/bash/bashrc.d/man.bash @@ -15,7 +15,8 @@ _man() { section='man'${COMP_WORDS[COMP_CWORD-1]} fi - # Read slash-separated output from a subshell into the COMPREPLY array + # Read slash-separated output from a subshell into the COMPREPLY array; use + # read -a rather than adding each element individually, as it's much faster IFS=/ read -a COMPREPLY -d '' -r < <( # Do not return dotfiles, and expand empty globs to just nothing @@ -43,8 +44,7 @@ _man() { # printing ((${#pages[@]})) || exit 1 - # Print the pages array to stdout, newline-separated; see above - # explanation + # Print the pages array to stdout, slash-separated, null-terminated (IFS=/ ; printf '%q\0' "${pages[*]}") ) } -- cgit v1.2.3