nmh-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-commits] nmh ChangeLog h/utils.h sbr/utils.c uip/inc.c


From: Josh Bressers
Subject: [Nmh-commits] nmh ChangeLog h/utils.h sbr/utils.c uip/inc.c
Date: Tue, 21 Aug 2007 21:19:40 +0000

CVSROOT:        /sources/nmh
Module name:    nmh
Changes by:     Josh Bressers <bress>   07/08/21 21:19:40

Modified files:
        .              : ChangeLog 
        h              : utils.h 
        sbr            : utils.c 
        uip            : inc.c 

Log message:
        * Red Hat Bug #253342: inc.c, utils.c, utils.h: When inc is run with the
        -silent flag, don't exit(1) for no apparent reason.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/nmh/ChangeLog?cvsroot=nmh&r1=1.248&r2=1.249
http://cvs.savannah.gnu.org/viewcvs/nmh/h/utils.h?cvsroot=nmh&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/nmh/sbr/utils.c?cvsroot=nmh&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/nmh/uip/inc.c?cvsroot=nmh&r1=1.23&r2=1.24

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/nmh/nmh/ChangeLog,v
retrieving revision 1.248
retrieving revision 1.249
diff -u -b -r1.248 -r1.249
--- ChangeLog   21 Mar 2007 00:21:10 -0000      1.248
+++ ChangeLog   21 Aug 2007 21:19:39 -0000      1.249
@@ -1,3 +1,8 @@
+2007-08-21  Josh Bressers <address@hidden>
+
+       * Red Hat Bug #253342: inc.c, utils.c, utils.h: When inc is run with
+       the -silent flag, don't exit(1) for no apparent reason.
+
 2007-03-12  Peter Maydell <address@hidden>
 
        * bug #18630, #18631, #18632, #18634: various patches from

Index: h/utils.h
===================================================================
RCS file: /sources/nmh/nmh/h/utils.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- h/utils.h   14 Apr 2006 14:10:15 -0000      1.8
+++ h/utils.h   21 Aug 2007 21:19:39 -0000      1.9
@@ -2,13 +2,14 @@
 /*
  * utils.h -- utility prototypes
  *
- * $Id: utils.h,v 1.8 2006/04/14 14:10:15 jjr Exp $
+ * $Id: utils.h,v 1.9 2007/08/21 21:19:39 bress Exp $
  */
 
 void *mh_xmalloc(size_t);
 void *mh_xrealloc(void *, size_t);
 char *pwd(void);
 char *add(char *, char *);
+int folder_exists(char *);
 void create_folder(char *, int, void (*)());
 int num_digits(int);
 

Index: sbr/utils.c
===================================================================
RCS file: /sources/nmh/nmh/sbr/utils.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- sbr/utils.c 14 Apr 2006 14:10:16 -0000      1.9
+++ sbr/utils.c 21 Aug 2007 21:19:39 -0000      1.10
@@ -2,7 +2,7 @@
 /*
  * utils.c -- various utility routines
  *
- * $Id: utils.c,v 1.9 2006/04/14 14:10:16 jjr Exp $
+ * $Id: utils.c,v 1.10 2007/08/21 21:19:39 bress Exp $
  *
  * This code is Copyright (c) 2006, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -121,6 +121,29 @@
 }
 
 /*
+ * folder_exists
+ *      Check to see if a folder exists.
+ */
+int folder_exists(char *folder)
+{
+    struct stat st;
+    int exists = 0;
+
+    if (stat (folder, &st) == -1) {
+        /* The folder either doesn't exist, or we hit an error.  Either way
+         * return a failure.
+         */
+        exists = 0;
+    } else {
+        /* We can see a folder with the right name */
+        exists = 1;
+    }
+
+    return exists;
+}
+
+
+/*
  * create_folder
  *      Check to see if a folder exists, if not, prompt the user to create
  *      it.

Index: uip/inc.c
===================================================================
RCS file: /sources/nmh/nmh/uip/inc.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- uip/inc.c   27 Apr 2006 12:00:28 -0000      1.23
+++ uip/inc.c   21 Aug 2007 21:19:39 -0000      1.24
@@ -2,7 +2,7 @@
 /*
  * inc.c -- incorporate messages from a maildrop into a folder
  *
- * $Id: inc.c,v 1.23 2006/04/27 12:00:28 jjr Exp $
+ * $Id: inc.c,v 1.24 2007/08/21 21:19:39 bress Exp $
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
@@ -563,10 +563,15 @@
     if ((maildir_copy = strdup(maildir)) == (char *)0)
         adios (maildir, "error allocating memory to copy maildir");
 
+    if (!folder_exists(maildir)) {
+        /* If the folder doesn't exist, and we're given the -silent flag,
+         * just fail.
+         */
     if (noisy)
         create_folder(maildir, 0, done);
     else
         done (1);
+    }
 
     if (chdir (maildir) == NOTOK)
        adios (maildir, "unable to change directory to");




reply via email to

[Prev in Thread] Current Thread [Next in Thread]