This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=40b616f3dc7fe378846235975a09ebee15b37013

The branch, master has been updated
       via  40b616f3dc7fe378846235975a09ebee15b37013 (commit)
      from  87e9c7921d151d1b978348f94a1475423bf9dbfe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 40b616f3dc7fe378846235975a09ebee15b37013
Author: Sergey Poznyakoff <g...@gnu.org>
Date:   Sun May 3 23:29:43 2015 +0300

    readmsg: minor fix
    
    * readmsg/readmsg.c: Bail out unless arguments are present.
    * doc/texinfo/programs.texi: Update.

-----------------------------------------------------------------------

Summary of changes:
 doc/texinfo/programs.texi |    5 +++++
 readmsg/readmsg.c         |   12 +++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/doc/texinfo/programs.texi b/doc/texinfo/programs.texi
index 4e82cd5..f9d4aba 100644
--- a/doc/texinfo/programs.texi
+++ b/doc/texinfo/programs.texi
@@ -4853,6 +4853,11 @@ Note that it will not match a message containing 
@samp{Staff Meeting}
 which matches the pattern is printed.
 @end enumerate
 
+Unless one of the informational options is used, at least one command
+line argument must be present.  Informational options are:
+@option{--help} (@option{-?}), @option{--usage}, and
+@option{--version} (@option{-V}).
+
 @menu
 * Opt-readmsg::   Invocation of @command{readmsg}.
 * Conf-readmsg::  Configuration of @command{readmsg}.
diff --git a/readmsg/readmsg.c b/readmsg/readmsg.c
index 1b52ca6..767c32f 100644
--- a/readmsg/readmsg.c
+++ b/readmsg/readmsg.c
@@ -297,6 +297,14 @@ main (int argc, char **argv)
                   argc, argv, 0, &index, NULL))
     exit (1);
 
+  argc -= index;
+
+  if (argc == 0)
+    {
+      mu_error (_("not enough arguments"));
+      exit (1);
+    }
+
   status = mu_mailbox_create_default (&mbox, mailbox_name);
   if (status != 0)
     {
@@ -367,9 +375,7 @@ main (int argc, char **argv)
     }
 
   /* Build an array containing the message number.  */
-  argc -= index;
-  if (argc > 0)
-    msglist (mbox, show_all, argc, &argv[index], &set, &n);
+  msglist (mbox, show_all, argc, &argv[index], &set, &n);
 
   for (i = 0; i < n; ++i)
     {


hooks/post-receive
-- 
GNU Mailutils

_______________________________________________
Commit-mailutils mailing list
Commit-mailutils@gnu.org
https://lists.gnu.org/mailman/listinfo/commit-mailutils

Reply via email to