Skip to content

Commit

Permalink
Revert absolute path replacements to bash version
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpurra committed Oct 12, 2014
1 parent ba21172 commit dd53ba9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/play-shared-functions.sh
Expand Up @@ -55,12 +55,15 @@ getOrGenerateSoundCache() {

absoluteSoundPaths() {
# Using read seems to be about 7 times slower than sed - why?
# while IFS= read -r -d '' sound;
# do
# echo -n "${sharedCwd}/${sound/.\/}"
# echo -n -e "\0"
# done
nullAsNewline sed -e 's|^./||' -e "s|^|${sharedCwd}/|"
# NOTE: The sed version might be suceptible to improperly escaped characters.
# TODO: Can be written as a sed replace using \0 instead of nullAsNewline?
# nullAsNewline sed -e 's|^./||' -e "s|^|$(echo -n -e "${sharedCwd/&/\\&}")/|"

while IFS= read -r -d '' sound;
do
echo -n "${sharedCwd}/${sound/#.\/}"
echo -n -e "\0"
done
}

getSounds() {
Expand Down

0 comments on commit dd53ba9

Please sign in to comment.