aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_print_make_targets.fish
diff options
context:
space:
mode:
authorGravatar Evan Jones <ej@evanjones.ca>2012-06-17 07:17:05 -0400
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-06-17 15:01:04 -0700
commit01780f19b1ffda0026e44a116d27d887dbfb096e (patch)
tree0df02bbf15d5740cdf10db9e528f887266907e83 /share/functions/__fish_print_make_targets.fish
parent1fa0c4d4d3ea5de180c3f64aa00c478c90f04904 (diff)
Fix other usages of \n in sed replacements.
Diffstat (limited to 'share/functions/__fish_print_make_targets.fish')
-rw-r--r--share/functions/__fish_print_make_targets.fish6
1 files changed, 5 insertions, 1 deletions
diff --git a/share/functions/__fish_print_make_targets.fish b/share/functions/__fish_print_make_targets.fish
index c57e8871..bda806f4 100644
--- a/share/functions/__fish_print_make_targets.fish
+++ b/share/functions/__fish_print_make_targets.fish
@@ -1,4 +1,8 @@
function __fish_print_make_targets
set files Makefile makefile GNUmakefile
- sgrep -h -E '^[^#%=$[:space:]][^#%=$]*:([^=]|$)' $files | cut -d ":" -f 1 | sed -e 's/^ *//;s/ *$//;s/ */\n/g' ^/dev/null
+ # Some seds (e.g. on Mac OS X), don't support \n in the RHS
+ # Use a literal newline instead
+ # http://sed.sourceforge.net/sedfaq4.html#s4.1
+ sgrep -h -E '^[^#%=$[:space:]][^#%=$]*:([^=]|$)' $files | cut -d ":" -f 1 | sed -e 's/^ *//;s/ *$//;s/ */\\
+/g' ^/dev/null
end