On 2013-08-20 13:40, Alan Hicks wrote:
Hi,
On 20/08/2013 10:14, Thomas Raschbacher wrote:
hi.
just noticed something a bit odd:
# dbmail-users -V
This is DBMail version 0.9.9
Copyright (C) 1999-2004 IC & S, [email protected]
Copyright (C) 2001-2007 Aaron Stone, [email protected]
Copyright (C) 2004-2011 NFG Net Facilities Group BV, [email protected]
Please see the AUTHORS and THANKS files for additional contributors.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
It lists version 0.9.9 ?
I don't have time to check the code now as to why it does this though,
but somewhere
the print statement doesn'T seem to work out right.
The version is from mutils/mhash_config.h
For FreeBSD I include the config.h a second time to get round this.
Regards,
Alan
--- src/dbmail.h.in.orig
+++ src/dbmail.h.in
@@ -154,6 +160,11 @@
#include <endian.h>
#endif
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
#define GETCONFIGVALUE(key, sect, var) \
config_get_value(key, sect, var); \
if (strlen(var) > 0) \
on a side note: you probably also want to change COPYRIGHT in dbmail.h
to include 2013 as it says 2011
at the moment.
Regards
Ah thanks for the hint.
in that case though wouldn't it be better to just import it only
afterwards?
Maybe someone should tell mutils folks that it might not be the best
idea to export VERSION
in a library header? (I mean they could just use MHASH_VERSION)
Apart from that I think it would be best maybe to not use VERSION but
rather change the name to DBMAIL_VERSION, since that would also prevent
this problem occuring again at some later point when another library
header exports this again. (I don't know how easy it is to change
configure stuff to use DBMAIL_VERSION instead of VERSION, so you could
just #define DBMAIL_VERSION VERSION right after the include to make it
simple)
also it looks like the variable is not used a lot anyway so changing it
should be easy imho
# grep "[^_@A-Z$]VERSION" * -rn | egrep '[a-zA-Z1-9]+\.[ch]'
config.h:144:#define VERSION "3.1.3"
src/timsieve.c:79: ci_write(session->ci,
"\"IMPLEMENTATION\" \"DBMail timsieved %s\"\r\n", VERSION);
src/imapcommands.c:235: " \"os\" \"%s\" \"os-version\"
\"%s\")\r\n", VERSION, &buf.sysname, &buf.release);
src/dbmail.h:166:#define PRINTF_THIS_IS_DBMAIL printf("This is DBMail
version %s\n\n%s\n", VERSION, COPYRIGHT)
src/dbmail.h.in:166:#define PRINTF_THIS_IS_DBMAIL printf("This is DBMail
version %s\n\n%s\n", VERSION, COPYRIGHT)
src/imap4.c:311:
Capa_as_string(session->preauth_capa), VERSION);
src/modules/authldap.c:58: GETCONFIGVALUE("VERSION",
"LDAP", _ldap_cfg.version);
(The last one most likely has nothing to do with it i guess - and i
didn'T read the imap ones)
Or would it be ok/better to just include config.h *last* of all includes
?
what do you think paul?
_______________________________________________
DBmail mailing list
[email protected]
http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail