diff options
Diffstat (limited to 'git-email.el')
-rw-r--r-- | git-email.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/git-email.el b/git-email.el index a66fd16..40588e5 100644 --- a/git-email.el +++ b/git-email.el @@ -50,12 +50,15 @@ :type 'symbol) (defun git-email--extract-header (header patch-file) - "Extract HEADER from PATCH-FILE." + "Extract HEADER from PATCH-FILE. +If the header is not found, return an empty string." (with-temp-buffer (insert-file-contents patch-file) (goto-char (point-min)) (buffer-substring-no-properties - (re-search-forward (format " *%s: +" header)) + (if (re-search-forward (format " *%s: +" header) nil t) + (point) + (point-at-eol)) (point-at-eol)))) (defun git-email--extract-diff (patch-file) |