Skip to content

Commit

Permalink
dired-rsync: don't trigger errors in filter function
Browse files Browse the repository at this point in the history
`search-backward' can fail if there is no \r to find which seems to
happen in some cases. Handle the failure more gracefully.

Fixes: 49
  • Loading branch information
stsquad committed Aug 22, 2023
1 parent 95607fc commit 5bcb851
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dired-rsync.el
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ information and update the dired-rsync-modeline-status."
(set-marker (process-mark proc) (point))
;; Delete old text upto the newline
(goto-char (point-max))
(when (search-backward "\r")
(when (search-backward "\r" nil t)
(delete-region (point-min) (+ 1 (match-beginning 0)))))
(if moving
(goto-char (process-mark proc))))))))
Expand Down

0 comments on commit 5bcb851

Please sign in to comment.