Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ani-cli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

version_number="4.10.6"
version_number="4.10.7"

# UI

Expand Down Expand Up @@ -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"
Expand Down
Loading