From 147a7b66554b2b13bcbf6fec1204e0cc0a1790bf Mon Sep 17 00:00:00 2001 From: Mike Burns and Eric Collins Date: Fri, 23 Dec 2016 16:18:40 -0500 Subject: Handle spaces in dotfile name In mkrc, separate the list of files with newlines instead of spaces. Change the `$IFS` when iterating to handle this. We hand the file off to rcup, which encodes the file name by replacing spaces with the bell character (`\a`). rcup then sends the file name off to lsrc, which decodes the bell back into a space. The test makes sure an `a` character is in the filename, in case some encoding goes wrong. We use tr(1) instead of sed(1) because tr(1) handles `\a`. Shoutout to Sublime Text 3 for forcing this issue. --- test/lsrc-spaces.t | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/lsrc-spaces.t (limited to 'test/lsrc-spaces.t') diff --git a/test/lsrc-spaces.t b/test/lsrc-spaces.t new file mode 100644 index 0000000..fa406e2 --- /dev/null +++ b/test/lsrc-spaces.t @@ -0,0 +1,8 @@ + $ . "$TESTDIR/helper.sh" + +Should handle dotfiles with spaces + + $ touch ".dotfiles/sublame text 3.config" + + $ lsrc + /*/.sublame text 3.config:/*/.dotfiles/sublame text 3.config (glob) -- cgit v1.2.3