From d7e194b09d40dd5a29668ae61b826ad31c9d4c0f Mon Sep 17 00:00:00 2001 From: Yujie Wu Date: Sat, 1 May 2010 00:49:47 +0800 Subject: [PATCH 1/2] Fixed bug for replace command. --- todo.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/todo.sh b/todo.sh index 3cbebe3..e430bfb 100755 --- a/todo.sh +++ b/todo.sh @@ -1011,7 +1011,7 @@ note: PRIORITY must be anywhere from A to Z." if [ -z $priority ]; then sed -i.bak $item" s|^.*|$input|" "$TODO_FILE" else - sed -i.bak -e "$item s/^(.) //" -e "$item s|^.*|\($priority\) $1|" "$TODO_FILE" + sed -i.bak -e "$item s/^(.) //" -e "$item s|^.*|\($priority\) $input|" "$TODO_FILE" fi [ $TODOTXT_VERBOSE -gt 0 ] && { NEWTODO=$(head -$item "$TODO_FILE" | tail -1) From 2a65615c7a3f1a40a1f75f406870d84c50f2571a Mon Sep 17 00:00:00 2001 From: Yujie Wu Date: Sat, 1 May 2010 00:50:40 +0800 Subject: [PATCH 2/2] Added a case for the fixed replace command. --- tests/t1100-replace.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/t1100-replace.sh b/tests/t1100-replace.sh index caf00b3..e39ad4c 100755 --- a/tests/t1100-replace.sh +++ b/tests/t1100-replace.sh @@ -71,6 +71,11 @@ TODO: 4 prioritized (A). 4: (A) collect the eggs replaced with 4: (A) collect the bread + +>>> todo.sh replace 4 collect the eggs +4: (A) collect the bread +replaced with +4: (A) collect the eggs EOF test_todo_session 'replace with &' << EOF >>> todo.sh replace 3 "thrash the hay & thresh the wheat"