[PATCH] D47273: [bash-completion] Fix tab separation on macOS

Ben Langmuir via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 23 13:33:33 PDT 2018

benlangmuir updated this revision to Diff 148278.
benlangmuir edited the summary of this revision.
benlangmuir added a comment.

Thanks for looking up  the supported bash version!  Updated diff.



Index: utils/bash-autocomplete.sh
--- utils/bash-autocomplete.sh
+++ utils/bash-autocomplete.sh
@@ -38,7 +38,8 @@
   # expand ~ to $HOME
   eval local path=${COMP_WORDS[0]}
-  flags=$( "$path" --autocomplete="$arg" 2>/dev/null | sed -e 's/\t.*//' )
+  # Use $'\t' so that bash expands the \t for older versions of sed.
+  flags=$( "$path" --autocomplete="$arg" 2>/dev/null | sed -e $'s/\t.*//' )
   # If clang is old that it does not support --autocomplete,
   # fall back to the filename completion.
   if [[ "$?" != 0 ]]; then

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47273.148278.patch
Type: text/x-patch
Size: 599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180523/8d9b9f3e/attachment.bin>

More information about the cfe-commits mailing list