From c02a18bc7c8124e91ea1b98d41ae961a1a98e6d6 Mon Sep 17 00:00:00 2001 From: saschabuehrle Date: Sun, 22 Mar 2026 15:44:05 +0100 Subject: [PATCH 1/2] fix: escape sed special chars in update_history to handle & in titles (fixes #1576) Titles containing '&' (e.g. 'Panty & Stocking with Garterbelt') corrupted the history file because '&' in sed's replacement string means 'the entire matched text'. This caused the matched line to be duplicated inside the replacement, breaking history continuation. Escape &, \, and | in the title before using it in the sed replacement string. --- ani-cli | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ani-cli b/ani-cli index 677b59daa..a59f2fd50 100755 --- a/ani-cli +++ b/ani-cli @@ -277,7 +277,9 @@ process_hist_entry() { update_history() { if grep -q -- "$id" "$histfile"; then - sed -E "s|^[^ ]+ ${id} [^ ]+$|${ep_no} ${id} ${title}|" "$histfile" >"${histfile}.new" + # escape sed special chars in replacement: & and \ and delimiter | + safe_title=$(printf '%s' "$title" | sed 's/[&\|]/\\&/g') + sed -E "s|^[^ ]+ ${id} [^ ]+$|${ep_no} ${id} ${safe_title}|" "$histfile" >"${histfile}.new" else cp "$histfile" "${histfile}.new" printf "%s\t%s\t%s\n" "$ep_no" "$id" "$title" >>"${histfile}.new" From b7b4bc31330f3b8cce2d74617d87d31b79e41228 Mon Sep 17 00:00:00 2001 From: saschabuehrle Date: Mon, 23 Mar 2026 15:31:33 +0100 Subject: [PATCH 2/2] bump version to 4.10.7 --- ani-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ani-cli b/ani-cli index a59f2fd50..30e626fff 100755 --- a/ani-cli +++ b/ani-cli @@ -1,6 +1,6 @@ #!/bin/sh -version_number="4.10.6" +version_number="4.10.7" # UI