Github messages for mblaze
 help / color / mirror / Atom feed
* [PR PATCH] mcom: check if a draft was found when invoking `mcom -r`
@ 2020-01-12 15:43 mblaze-github
  2020-01-12 15:55 ` [PR PATCH] [Closed]: " mblaze-github
  0 siblings, 1 reply; 2+ messages in thread
From: mblaze-github @ 2020-01-12 15:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 577 bytes --]

There is a new pull request by nmeum against master on the mblaze repository

https://github.com/nmeum/mblaze mcom-no-drafts
https://github.com/leahneukirchen/mblaze/pull/169

mcom: check if a draft was found when invoking `mcom -r`
Without this patch `mcom -r` would invoke $EDITOR on a directory if the
maildir did not contain any drafts. To prevent this from happening,
check if a draft was found before performing any further processing. If
not, terminate mcom with an error message.

A patch file from https://github.com/leahneukirchen/mblaze/pull/169.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mcom-no-drafts-169.patch --]
[-- Type: text/x-diff, Size: 877 bytes --]

From f27bc561c342db5f106d187517d5f7373468b2a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
Date: Sun, 12 Jan 2020 16:34:55 +0100
Subject: [PATCH] mcom: check if a draft was found when invoking `mcom -r`

Without this patch `mcom -r` would invoke $EDITOR on a directory if the
maildir did not contain any drafts. To prevent this from happening,
check if a draft was found before performing any further processing. If
not, terminate mcom with an error message.
---
 mcom | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mcom b/mcom
index e0aeaf7..3658dcb 100755
--- a/mcom
+++ b/mcom
@@ -250,6 +250,11 @@ else
 	draftmime="$(printf '%s\n' "$draft" | sed 's,\(.*\)/cur/,\1/tmp/mime-,')"
 fi
 
+if [ -n "$resume" ] && [ -z "$draft" ]; then
+	echo "mcom: no draft found"
+	exit 1
+fi
+
 [ -z "$resume" ] &&
 {
 	case "$0" in

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-12 15:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-12 15:43 [PR PATCH] mcom: check if a draft was found when invoking `mcom -r` mblaze-github
2020-01-12 15:55 ` [PR PATCH] [Closed]: " mblaze-github

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).