BUG: foamCleanPath problem if path contains @ (closes #264)

- Can occur with some user names, or mounted paths.
  Resolve by using '?' for the separation character.

  Since '?' is a shell-glob, it is highly unlikely to occur appear in
  filenames.  Additionally, it is not a meta-character in standard sed,
  nor in the GNU extension (which uses '\?').
This commit is contained in:
Mark Olesen
2016-10-18 09:52:37 +02:00
parent fe6ea956f7
commit 03b5d5c108
2 changed files with 6 additions and 6 deletions

View File

@ -99,7 +99,7 @@ IFS=': '
# or may contain ':' separators
set -- $*
# strip out wildcards via sed
# Strip out wildcards via sed. Path and wildcard cannot contain '?'.
while [ "$#" -ge 1 ]
do
wildcard=$1
@ -107,7 +107,7 @@ do
##DEBUG echo "remove>$wildcard<" 1>&2
if [ -n "$wildcard" ]
then
dirList=$(echo "$dirList:" | sed -e "s@${wildcard}[^:]*:@@g")
dirList=$(echo "$dirList:" | sed -e "s?${wildcard}[^:]*:??g")
fi
done