Skip to content

Commit

Permalink
counsel.el (counsel--call): Remove stderr guards
Browse files Browse the repository at this point in the history
delete-file does not signal an error when given a non-existent file,
and guarding insert-file-contents is at best unnecessary and at
worst a race condition.

Re: abo-abo#1828
  • Loading branch information
basil-conto committed Nov 29, 2018
1 parent 472befb commit 5dd66d5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions counsel.el
Expand Up @@ -1339,13 +1339,12 @@ COMMAND fails. Obey file handlers based on `default-directory'."
(lwarn 'ivy :warning "%s"
(apply #'concat
(error-message-string res)
(when (file-readable-p stderr)
(insert-file-contents stderr nil nil nil t)
(unless (zerop (cadr (insert-file-contents
stderr nil nil nil t)))
(list "\n" (buffer-string)))))
(signal (car res) (cdr res)))
(buffer-substring (point-min) (- (point) (if (bolp) 1 0)))))
(when (file-exists-p stderr)
(delete-file stderr)))))
(delete-file stderr))))

(defun counsel--git-grep-count-func-default ()
"Default function to calculate `counsel--git-grep-count'."
Expand Down

0 comments on commit 5dd66d5

Please sign in to comment.