Minor: Move cleaninput call closer to sed command.

This commit is contained in:
Ingo Karkat
2012-04-19 14:19:30 +02:00
parent e0b93e48fb
commit f45bbd1a1d

View File

@@ -389,7 +389,6 @@ replaceOrPrepend()
else
input=$*
fi
cleaninput "for sed"
# Retrieve existing priority and prepended date
local -r priAndDateExpr='^\((.) \)\{0,1\}\([0-9]\{2,4\}-[0-9]\{2\}-[0-9]\{2\} \)\{0,1\}'
@@ -405,6 +404,7 @@ replaceOrPrepend()
# Temporarily remove any existing priority and prepended date, perform the
# change (replace/prepend) and re-insert the existing priority and prepended
# date again.
cleaninput "for sed"
sed -i.bak -e "$item s/^${priority}${prepdate}//" -e "$item s|^.*|${priority}${prepdate}${input}${backref}|" "$TODO_FILE"
if [ $TODOTXT_VERBOSE -gt 0 ]; then
getNewtodo "$item"