rpms/nmh/F-7 fix-inc.patch,NONE,1.1 nmh.spec,1.21,1.22
Josh Bressers (bressers)
fedora-extras-commits at redhat.com
Tue Aug 21 20:56:37 UTC 2007
Author: bressers
Update of /cvs/extras/rpms/nmh/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21015/F-7
Modified Files:
nmh.spec
Added Files:
fix-inc.patch
Log Message:
Add a fix for bug #253342
fix-inc.patch:
--- NEW FILE fix-inc.patch ---
? cscope.out
? fix-inc.patch
? uip/inc.c.new
Index: h/utils.h
===================================================================
RCS file: /sources/nmh/nmh/h/utils.h,v
retrieving revision 1.8
diff -a -u -r1.8 utils.h
--- h/utils.h 14 Apr 2006 14:10:15 -0000 1.8
+++ h/utils.h 20 Aug 2007 13:16:23 -0000
@@ -9,6 +9,7 @@
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
diff -a -u -r1.9 utils.c
--- sbr/utils.c 14 Apr 2006 14:10:16 -0000 1.9
+++ sbr/utils.c 20 Aug 2007 13:16:24 -0000
@@ -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
diff -a -u -r1.23 inc.c
--- uip/inc.c 27 Apr 2006 12:00:28 -0000 1.23
+++ uip/inc.c 20 Aug 2007 13:16:24 -0000
@@ -563,10 +563,15 @@
if ((maildir_copy = strdup(maildir)) == (char *)0)
adios (maildir, "error allocating memory to copy maildir");
- if (noisy)
- create_folder(maildir, 0, done);
- else
- done (1);
+ 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");
Index: nmh.spec
===================================================================
RCS file: /cvs/extras/rpms/nmh/F-7/nmh.spec,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- nmh.spec 4 Feb 2007 13:49:16 -0000 1.21
+++ nmh.spec 21 Aug 2007 20:56:05 -0000 1.22
@@ -1,6 +1,6 @@
Name: nmh
Version: 1.2
-Release: 20070115cvs.3%{?dist}
+Release: 20070115cvs.4%{?dist}
Summary: A capable mail handling system with a command line interface.
Group: Applications/Internet
@@ -8,6 +8,7 @@
URL: http://savannah.nongnu.org/projects/nmh
Source0: nmh-1.2-20070115cvs.tar.gz
Patch0: nmh-1.1-inc_install.patch
+Patch1: fix-inc.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ncurses-devel
BuildRequires: db4-devel
@@ -28,6 +29,7 @@
%prep
%setup -q -n nmh-1.2-20070115cvs
%patch0 -p0
+%patch1 -p0
%build
CFLAGS="$RPM_OPT_FLAGS -fno-builtin-strcasecmp"
@@ -62,6 +64,9 @@
%doc docs/TODO docs/README* COPYRIGHT
%changelog
+* Tue Aug 21 2007 Josh Bressers <bressers at redhat.com> 0:1.2_20070115cvs.4
+- Fix inc when the -silent flag is used
+
* Sun Feb 04 2007 Josh Bressers <bressers at redhat.com> 0:1.2_20070115cvs.3
- Use double quotes not single quotes for CFLAGS
More information about the fedora-extras-commits
mailing list