From 8e4364f5e1c559116370bf6a8564972da6c8ec9e Mon Sep 17 00:00:00 2001 From: Nick Wilson Date: Mon, 31 Jan 2011 21:07:35 -0800 Subject: [PATCH] Fix erroneously removing pipe chars from input cleaninput() unintentionally deletes the '|' character from input. This commit fixes it and adds test for adding tasks with a bunch of symbols. --- tests/t1000-addlist.sh | 16 ++++++++++------ todo.sh | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/t1000-addlist.sh b/tests/t1000-addlist.sh index e27557e..74cb037 100755 --- a/tests/t1000-addlist.sh +++ b/tests/t1000-addlist.sh @@ -58,19 +58,23 @@ TODO: 3 added. TODO: 2 of 3 tasks shown EOF -test_todo_session 'add with &' <>> todo.sh add "dig the garden & water the flowers" -4 dig the garden & water the flowers +test_todo_session 'add with symbols' <>> todo.sh add "~@#$%^&*()-_=+[{]}|;:',<.>/?" +4 ~@#$%^&*()-_=+[{]}|;:',<.>/? TODO: 4 added. +>>> todo.sh add '\`!\\"' +5 \`!\\" +TODO: 5 added. + >>> todo.sh list -4 dig the garden & water the flowers 1 notice the daisies 2 smell the roses 3 smell the uppercase Roses +5 \`!\\" +4 ~@#$%^&*()-_=+[{]}|;:',<.>/? -- -TODO: 4 of 4 tasks shown - +TODO: 5 of 5 tasks shown EOF test_done diff --git a/todo.sh b/todo.sh index f2cbb24..aab6314 100755 --- a/todo.sh +++ b/todo.sh @@ -260,7 +260,7 @@ cleaninput() { # Cleanup the input # Replace newlines with spaces Always - input=`echo $input | tr -d '\r|\n'` + input=`echo $input | tr -d '\r\n'` action_regexp="^\(append\|app\|prepend\|prep\|replace\)$"