Bernhard Reiter <bernhard@intevation.de> (Jul 21 2002)
   Made code which parses gdbm option "-g" more consistant.

--- hypermail-2.1.4/src/hypermail.c.org	Sun Jul 21 13:08:33 2002
+++ hypermail-2.1.4/src/hypermail.c	Sun Jul 21 13:37:06 2002
@@ -130,7 +130,11 @@
     printf("  -b URL        : %s\n", lang[MSG_OPTION_B]);
     printf("  -c file       : %s\n", lang[MSG_OPTION_C]);
     printf("  -d dir        : %s\n", lang[MSG_OPTION_D]);
+#ifdef GDBM
     printf("  -g            : %s\n", lang[MSG_OPTION_G]);
+#else
+    printf("  [ -g            : %s ]\n", lang[MSG_OPTION_G_NOT_BUILD_IN]);
+#endif
     printf("  -i            : %s\n", lang[MSG_OPTION_I]);
     printf("  -l label      : %s\n", lang[MSG_OPTION_L]);
     printf("  -m mbox       : %s\n", lang[MSG_OPTION_M]);
@@ -191,11 +195,7 @@
 
     /* get pre config options here */
     while ((i = getopt(argc,argv,
-#ifdef GDBM
 			    "a:Ab:c:d:gil:L:m:n:o:ps:tTuvVx0:1M?"
-#else
-			    "a:Ab:c:d:il:L:m:n:o:ps:tTuvVx0:1M?"
-#endif
 			    )) != -1) {
         switch((char) i) {
 	case 'c':
@@ -210,9 +210,7 @@
 	case 'A':
 	case 'b':
 	case 'd':
-#ifdef GDBM
 	case 'g':
-#endif
 	case 'i':
 	case 'l':
 	case 'L':
@@ -253,11 +251,7 @@
     /* now get the post-config options! */
 
     while ((i = getopt(argc,argv,
-#ifdef GDBM
 			    "a:Ab:c:d:gil:L:m:n:o:ps:tTuvx0:1M?"
-#else
-			    "a:Ab:c:d:il:L:m:n:o:ps:tTuvx0:1M?"
-#endif
       )) != -1) {
         switch((char) i) {
 	case 'A':
@@ -275,11 +269,9 @@
 	case 'd':
 	    set_dir = strreplace(set_dir, optarg);
 	    break;
-#ifdef GDBM
 	case 'g':
 	    set_usegdbm = 1;
 	    break;
-#endif
 	case 'i':
 	    use_stdin = TRUE;
 	    break;
@@ -373,8 +365,17 @@
 	
     lang = tlang;		/* A good language, make it so. */
 
+
+
     if (print_usage)		/* Print the usage message and terminate */
 	usage();
+
+#ifndef GDBM
+    if (set_usegdbm) {
+    fprintf(stderr, "%s: %s\n", PROGNAME, lang[MSG_OPTION_G_NOT_BUILD_IN]);
+    usage();
+    }
+#endif
 
     if (set_mbox && !strcasecmp(set_mbox, "NONE")) {
 	use_stdin = TRUE;
--- hypermail-2.1.4/src/lang.h.org	Sun Jul 21 13:25:21 2002
+++ hypermail-2.1.4/src/lang.h  	Sun Jul 21 13:50:04 2002
@@ -151,28 +151,29 @@
 #define MSG_YEARLY_INDEX                         98
 
 #define MSG_OPTION_G                             99
-#define MSG_CREATING_GDBM_INDEX                  100
-#define MSG_CANT_CREATE_GDBM_INDEX               101
-#define MSG_OPTION_ARCHIVE                       102
-#define MSG_CANNOT_BOTH_READ_AND_WRITE_TO_MBOX   103
+#define MSG_OPTION_G_NOT_BUILD_IN                100
+#define MSG_CREATING_GDBM_INDEX                  101
+#define MSG_CANT_CREATE_GDBM_INDEX               102
+#define MSG_OPTION_ARCHIVE                       103
+#define MSG_CANNOT_BOTH_READ_AND_WRITE_TO_MBOX   104
 
 /* XXX Move these up with the others */
-#define MSG_ATTACHMENT_VIEW			 104
-#define MSG_BY_ATTACHMENT			 105
-#define MSG_WRITING_ATTACHMENT_INDEX  		 106
-#define MSG_BYTES                                107
-
-#define MSG_CANNOT_CREATE_SYMLINK                108
-#define MSG_CANNOT_UNLINK                        109
-#define MSG_PREV_DIRECTORY                       110
-#define MSG_NEXT_DIRECTORY                       111
-#define MSG_FOLDERS_INDEX                        112
-#define MSG_DELETED                              113
-#define MSG_EXPIRED                              114
-#define MSG_DEL_SHORT                            115
-#define MSG_TXT_VERSION                          116
-#define MSG_FILTERED_OUT                         117
-#define MSG_FROM                                 118
+#define MSG_ATTACHMENT_VIEW			 105
+#define MSG_BY_ATTACHMENT			 106
+#define MSG_WRITING_ATTACHMENT_INDEX  		 107
+#define MSG_BYTES                                108
+
+#define MSG_CANNOT_CREATE_SYMLINK                109
+#define MSG_CANNOT_UNLINK                        110
+#define MSG_PREV_DIRECTORY                       111
+#define MSG_NEXT_DIRECTORY                       112
+#define MSG_FOLDERS_INDEX                        113
+#define MSG_DELETED                              114
+#define MSG_EXPIRED                              115
+#define MSG_DEL_SHORT                            116
+#define MSG_TXT_VERSION                          117
+#define MSG_FILTERED_OUT                         118
+#define MSG_FROM                                 119
 
 #ifdef MAIN_FILE
 
@@ -289,6 +290,8 @@
   "Summary of Monthly Index Files",       /* monthly             -HTML*/
   "Summary of Yearly Index Files",        /* yearly              -HTML*/
   "Build a GDBM header cache",   /* Build a GDBM header cache   -STDOUT*/
+  "GDBM header cache option not build in",
+  		      /* GDBM header cache option not build in  -STDERR*/
   "Creating gdbm index... ",     /* Creating gdbm index         -STDOUT*/
   "Can't create gdbm file... ",  /* Can't create gdbm index     -STDOUT*/
   "Maintain an mbox archive",    /* Maintain an mbox archive    -STDOUT*/
@@ -417,6 +420,8 @@
   "Zestawienie miesięcy",           /* monthly             -HTML*/
   "Zestawienie lat",                /* yearly              -HTML*/
   "Utwórz cache nagłowków GDBM",    /* Build a GDBM header cache -STDOUT*/
+  "GDBM header cache option not build in",
+  		      /* GDBM header cache option not build in  -STDERR*/
   "Tworzenie indeksu GDBM... ",     /* Creating gdbm index -STDOUT*/
   "Nie można utworzyć pliku GDBM... ",  /* Can't create gdbm index     -STDOUT*/
   "Zachowaj archiwum mbox",         /* Maintain an mbox archive    -STDOUT*/
@@ -546,6 +551,8 @@
   "Summary of Monthly Index Files",       /* monthly             -HTML*/
   "Summary of Yearly Index Files",        /* yearly              -HTML*/
   "Build a GDBM header cache",   /* Build a GDBM header cache   -STDOUT*/
+  "GDBM header cache option not build in",
+  		      /* GDBM header cache option not build in  -STDERR*/
   "Creating gdbm index... ",     /* Creating gdbm index         -STDOUT*/
   "Can't create gdbm file... ",  /* Can't create gdbm index     -STDOUT*/
   "Maintain an mbox archive",    /* Maintain an mbox archive    -STDOUT*/
@@ -683,6 +690,8 @@
   "Summary of Monthly Index Files",   /* monthly             -HTML*/
   "Summary of Yearly Index Files",    /* yearly              -HTML*/
   "Build a GDBM header cache",   /* Build a GDBM header cache   -STDOUT*/
+  "GDBM header cache option not build in",
+  		      /* GDBM header cache option not build in  -STDERR*/
   "Creating gdbm index... ",     /* Creating gdbm index         -STDOUT*/
   "Can't create gdbm file... ",  /* Can't create gdbm index     -STDOUT*/
   "Maintain an mbox archive",    /* Maintain an mbox archive    -STDOUT*/
@@ -810,6 +819,8 @@
   "Summary of Monthly Index Files",      /* monthly             -HTML*/
   "Summary of Yearly Index Files",       /* yearly              -HTML*/
   "Build a GDBM header cache",   /* Build a GDBM header cache   -STDOUT*/
+  "GDBM header cache option not build in",
+  		      /* GDBM header cache option not build in  -STDERR*/
   "Creating gdbm index... ",     /* Creating gdbm index         -STDOUT*/
   "Can't create gdbm file... ",  /* Can't create gdbm index     -STDOUT*/
   "Maintain an mbox archive",    /* Maintain an mbox archive    -STDOUT*/
@@ -939,6 +950,8 @@
   "Summary of Monthly Index Files",        /* monthly             -HTML*/
   "Summary of Yearly Index Files",         /* yearly              -HTML*/
   "Creation d'un cache GDBM pour les en-tętes",  /* Build a GDBM header cache   -STDOUT*/
+  "GDBM header cache option not build in",
+  		      /* GDBM header cache option not build in  -STDERR*/
   "Generation de l'index GDBM... ",               /* Creating gdbm index         -STDOUT*/
   "Impossible de créer un fichier GDBM... ",    /* Can't create gdbm index     -STDOUT*/
   "Maintenance d'une archive email (mbox)",     /* Maintain an mbox archive    -STDOUT*/
@@ -1068,6 +1081,8 @@
   "Summary of Monthly Index Files",   /* monthly             -HTML*/
   "Summary of Yearly Index Files",    /* yearly              -HTML*/
   "Build a GDBM header cache",   /* Build a GDBM header cache   -STDOUT*/
+  "GDBM header cache option not build in",
+  		      /* GDBM header cache option not build in  -STDERR*/
   "Creating gdbm index... ",     /* Creating gdbm index         -STDOUT*/
   "Can't create gdbm file... ",  /* Can't create gdbm index     -STDOUT*/
   "Maintain an mbox archive",    /* Maintain an mbox archive    -STDOUT*/
@@ -1202,6 +1217,8 @@
   "Sammanfattning över mĺnatliga indexfiler", /* monthly             -HTML*/
   "Sammanfattning över ĺrliga indexfiler",  /* yearly              -HTML*/
   "Bygger en GDBM-headercache",   /* Build a GDBM header cache   -STDOUT*/
+  "GDBM header cache option not build in",
+  		      /* GDBM header cache option not build in  -STDERR*/
   "Skapar gdbm-index... ",     /* Creating gdbm index         -STDOUT*/
   "Kan inte skapa gdbm-fil... ",  /* Can't create gdbm index     -STDOUT*/
   "Underhĺll ett mbox-arkiv",    /* Maintain an mbox archive    -STDOUT*/
--- hypermail-2.1.4/src/hypermail.h	Sun Jul 21 16:14:58 2002
+++ hypermail-2.1.4+/src/hypermail.h	Sun Jul 21 16:16:34 2002
@@ -103,9 +103,7 @@
 #define NOEMAIL     "(no email)"
 #define NOSUBJECT   "(no subject)"
 
-#ifdef GDBM
 #define GDBM_INDEX_NAME ".hm2index"
-#endif
 
 #define NUMSTRLEN    10
 #define MAXLINE	     1024
--- hypermail-2.1.4/src/setup.c	Sun Jul 21 16:14:59 2002
+++ hypermail-2.1.4+/src/setup.c	Sun Jul 21 16:19:16 2002
@@ -48,9 +48,7 @@
 bool set_yearly_index;
 bool set_spamprotect;
 bool set_attachmentsindex;
-#ifdef GDBM
 bool set_usegdbm;
-#endif
 bool set_append;
 char *set_append_filename;
 bool set_warn_surpressions;
@@ -299,12 +297,14 @@
     {"uselock", &set_uselock, BTRUE, CFG_SWITCH,
      "# Set this to On to use hypermail's internal locking mechanism.\n"},
 
-#ifdef GDBM
     {"usegdbm",  &set_usegdbm,  BFALSE,    CFG_SWITCH,
      "# Set this to On to use gdbm to implement a header cache.\n"
      "#This will speed up hypermail, especially if your filesystem is slow.\n"
-     "#It will not provide any speedup with the linkquotes option.\n"},
+     "#It will not provide any speedup with the linkquotes option.\n"
+#ifndef GDBM
+     "#(This particular binary has been build with GDBM disabled.)\n"
 #endif
+    },
 
     {"append",  &set_append,  BFALSE,    CFG_SWITCH,
      "# Set this to On to maintain a parallel mbox archive. The file\n"
@@ -1032,9 +1032,7 @@
     printf("set_uselock = %d\n",set_uselock);
     printf("set_locktime = %d\n",set_locktime);
     printf("set_ietf_mbox = %d\n",set_ietf_mbox);
-#ifdef GDBM
     printf("set_usegdbm = %d\n",set_usegdbm);
-#endif
     printf("set_append = %d\n",set_append);
     printf("set_thrdlevels = %d\n",set_thrdlevels);
     printf("set_dirmode = %04o\n",set_dirmode);
--- hypermail-2.1.4/src/setup.h	Sun Jul 21 16:14:59 2002
+++ hypermail-2.1.4+/src/setup.h.old1	Sun Jul 21 17:57:49 2002
@@ -73,9 +73,7 @@
 extern bool set_yearly_index;
 extern bool set_spamprotect;
 extern bool set_attachmentsindex;
-#ifdef GDBM
 extern bool set_usegdbm;
-#endif
 extern bool set_append;
 extern char *set_append_filename;
 extern bool set_warn_surpressions;

