OSSP CVS Repository

ossp - Difference in ossp-pkg/lmtp2nntp/lmtp2nntp_option.c versions 1.28 and 1.29
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/lmtp2nntp/lmtp2nntp_option.c 1.28 -> 1.29

--- lmtp2nntp_option.c   2003/02/11 11:40:12     1.28
+++ lmtp2nntp_option.c   2003/02/11 12:54:58     1.29
@@ -378,10 +378,16 @@
         case OPT_SINGLE:
             if (arg == NULL)
                 return OPTION_ERR_ARG;
-        /*  add this if repeated overwriting definitions of single values are not allowed
-         *  if (oc->ndata >= 1 || oc->data.s != NULL)
+        /*  add this if repeated overwriting definitions of single values is not allowed
+         *  however, this will inhibit preinitialization with a default value
+         *  if (oc->ndata != 0)
          *      return OPTION_ERR_USE;
          */
+            if (oc->ndata == 1 && oc->data.s != NULL) { /* free previous (default) assignment */
+                free(oc->data.s);
+                oc->data.s = NULL;
+                oc->ndata = 0;
+            }
             if (cbctx != NULL)
                 if (str_parse(arg, cbctx) <= 0) {
                     fprintf(stderr, "ERROR: argument \"%s\" does NOT match syntax \"%s\"\n", arg, cbctx);

CVSTrac 2.0.1