Index: ossp-pkg/lmtp2nntp/lmtp2nntp.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp2nntp.c,v rcsdiff -q -kk '-r1.67' '-r1.68' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp2nntp.c,v' 2>/dev/null --- lmtp2nntp.c 2001/10/08 13:40:22 1.67 +++ lmtp2nntp.c 2001/10/08 14:30:11 1.68 @@ -401,13 +401,31 @@ switch (i) { case 'a': /*POD [B<-a> I] */ if ((rc = sa_addr_create(&ctx->saaAltio)) != SA_OK) { - fprintf(stderr, "%s:Error: Creating address failed for -i option (%d)\n", + fprintf(stderr, "%s:Error: Creating address failed for -a option (%d)\n", ctx->progname, rc); } - if ((rc = sa_addr_u2a(ctx->saaAltio, "inet://%s", optarg)) != SA_OK) { - fprintf(stderr, "%s:Error: Parsing inputbind address failed for \"%s\" (%d)\n", - ctx->progname, optarg, rc); - CU(ERR_EXECUTION); + if ((strncasecmp(optarg, "inet://", 7) == 0) || + (strncasecmp(optarg, "unix:/" , 6) == 0) ) { + if ((rc = sa_addr_u2a(ctx->saaAltio, "%s", optarg)) != SA_OK) { + fprintf(stderr, "%s:Error: Parsing alternate IO URL failed for \"%s\" (%d)\n", + ctx->progname, optarg, rc); + CU(ERR_EXECUTION); + } + } else { + if (optarg[0] == '/') { + if ((rc = sa_addr_u2a(ctx->saaAltio, "unix:%s", optarg)) != SA_OK) { + fprintf(stderr, "%s:Error: Parsing alternate IO guessing UNIX domain socket failed for \"%s\" (%d)\n", + ctx->progname, optarg, rc); + CU(ERR_EXECUTION); + } + } + else { + if ((rc = sa_addr_u2a(ctx->saaAltio, "inet://%s", optarg)) != SA_OK) { + fprintf(stderr, "%s:Error: Parsing alternate IO guessing INET socket failed for \"%s\" (%d)\n", + ctx->progname, optarg, rc); + CU(ERR_EXECUTION); + } + } } if ((rc = sa_create(&ctx->saAltio)) != SA_OK) { fprintf(stderr, "%s:Error: Creating TCP socket failed for \"%s\": %s\n", Index: ossp-pkg/lmtp2nntp/lmtp2nntp.pod RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp.pod,v rcsdiff -q -kk '-r1.23' '-r1.24' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp.pod,v' 2>/dev/null --- lmtp2nntp.pod 2001/10/08 13:50:01 1.23 +++ lmtp2nntp.pod 2001/10/08 14:30:11 1.24 @@ -117,7 +117,9 @@ Alternate IO allows reading and writing from/to a UNIX domain or TCP sockets instead stdin/stdout. This places the program in daemon mode. The syntax for -altio is either "unix:/path/to/socket" or "inet://address:port". +altio is either "unix:/path/to/socket" or "inet://address:port". If "unix:/" +and "inet://" prefixes are ommited the program tries to guess the desired mode +based on the existing of a leading slash. =item B<-m> I