OSSP CVS Repository

ossp - Check-in [1747]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1747
Date: 2002-Jan-31 15:47:13 (local)
2002-Jan-31 14:47:13 (UTC)
User:thl
Branch:
Comment: moved --nodename option
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/lmtp2nntp_config.c      1.26 -> 1.27     17 inserted, 0 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp_main.c      1.20 -> 1.21     0 inserted, 7 deleted

ossp-pkg/lmtp2nntp/lmtp2nntp_config.c 1.26 -> 1.27

--- lmtp2nntp_config.c   2002/01/31 14:43:52     1.26
+++ lmtp2nntp_config.c   2002/01/31 14:47:13     1.27
@@ -496,6 +496,23 @@
     }
     catch (ex)
         rethrow;
+
+    /* --nodename SINGLE */
+    try {
+        if (   (val_get(ctx->val, "option.nodename", &ov) != VAL_OK)
+            || (ov->ndata != 1)
+            || (ov->data.s == NULL)
+              ) throw(0,0,0);
+        log1(ctx, TRACE, "--nodename = \"%s\"", ov->data.s);
+
+        if (strlen(optarg) > sizeof(ctx->uname.nodename)-1) {
+            log1(ctx, ERROR, "option --nodename, name (%s) too long", ov->data.s);
+            throw(0,0,0);
+        }
+        strcpy(ctx->uname.nodename, ov->data.s);
+    }
+    catch (ex)
+        rethrow;
 CUS:
     return;
 }


ossp-pkg/lmtp2nntp/lmtp2nntp_main.c 1.20 -> 1.21

--- lmtp2nntp_main.c     2002/01/31 14:43:52     1.20
+++ lmtp2nntp_main.c     2002/01/31 14:47:13     1.21
@@ -456,13 +456,6 @@
     /* read in the arguments */
     while ((i = getopt(argc, argv, "C:DKP:Va:b:c:d:g:h:l:m:n:o:r:s:t:u:v")) != -1) {
         switch (i) {
-            case 'n': /*POD [B<-n> I<nodename>] */
-                if (strlen(optarg) > sizeof(ctx->uname.nodename)-1) {
-                        fprintf(stderr, "%s:Error: nodename \"%s\" to long to option -n.\n", ctx->progname, optarg);
-                        CU(ERR_EXECUTION);
-                }
-                strcpy(ctx->uname.nodename, optarg);
-                break;
             case 'o': /*POD [B<-o> I<operationmode>] */
                 if      (strcasecmp(optarg, "post") == 0)
                     ctx->option_operationmode = OPERATIONMODE_POST;

CVSTrac 2.0.1