Github messages for mblaze
 help / color / mirror / Atom feed
From: mblaze-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: [PR PATCH] mcom: check if a draft was found when invoking `mcom -r`
Date: Sun, 12 Jan 2020 16:43:17 +0100
Message-ID: <gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-169@inbox.vuxu.org> (raw)

[-- 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

             reply	other threads:[~2020-01-12 15:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-12 15:43 mblaze-github [this message]
2020-01-12 15:55 ` [PR PATCH] [Closed]: " mblaze-github

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-fa6558a0-26e0-48f6-803f-f5a8af34f6a8-mblaze-169@inbox.vuxu.org \
    --to=mblaze-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Github messages for mblaze

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/mblaze-github

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 mblaze-github mblaze-github/ http://inbox.vuxu.org/mblaze-github \
		mblaze-github@inbox.vuxu.org
	public-inbox-index mblaze-github

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.github.mblaze


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git