[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] about mhpath
From: |
markus schnalke |
Subject: |
Re: [Nmh-workers] about mhpath |
Date: |
Tue, 14 Dec 2010 16:53:25 +0100 |
User-agent: |
nmh 1.3 |
I also found some comments I added to the code because I was puzzled.
It would be nice to have it explained by someone who knows the code.
--- a/uip/mhpath.c Tue Nov 30 15:30:45 2010 -0300
+++ b/uip/mhpath.c Tue Dec 14 12:43:31 2010 -0300
@@ -97,6 +97,7 @@
* for all the message numbers from 1 to "new" since
* mhpath can select empty slots. If we are adding
* space at the end, we go ahead and add 10 slots.
+ * (Why 10 and not 1 for new? meillo)
*/
if (mp->hghmsg >= mp->hghoff) {
if (!(mp = folder_realloc (mp, 1, mp->hghmsg + 10)))
@@ -105,6 +106,13 @@
if (!(mp = folder_realloc (mp, 1, mp->hghoff)))
adios (NULL, "unable to allocate folder storage");
}
+ /*
+ * as folder_realloc() checks itself if the realloc really
+ * is necesary, why don't we then:
+ * if (!(mp = folder_realloc (mp, 1, mp->hghmsg+1)))
+ * adios (NULL, "unable to allocate folder storage");
+ * ? This at least appears most clear to me. meillo
+ */
mp->msgflags |= ALLOW_NEW; /* allow the "new" sequence */
For once I would simply like to know, but also I think this could be
a code quality matter. However, the effort needed to dig into it could
be high in contrast to the outcome.
meillo