summaryrefslogtreecommitdiff
path: root/news/newsfetch/files/patch-newsfetch.c
blob: 46a011aca30dc3b52e24d5fedcb84c2e0285a10a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
--- newsfetch.c.orig	Thu Jul 23 18:28:56 1998
+++ newsfetch.c	Fri Jan 26 23:41:22 2001
@@ -7,6 +7,7 @@
 
  
 #include <stdio.h>
+#include <string.h>
 #include <signal.h>
 #include <pwd.h>
 #include <sys/types.h>
@@ -28,6 +29,7 @@
 int wait_after_articles = 0, articles_fetched=0, last_than_current;
 int wait_for_time = 0, timeout=READ_TIMEOUT, article_fetching=0;
 int cleanup=1, max_article, news_target=0, first_article, only_list=0;
+int port = 119;
 char group[100], pipe_command[100];
 FILE *rcfp, *rctmpfp, *socket_fp[2];
 char lockfile[100];
@@ -59,6 +61,16 @@
 	getHomedir(homedir);
 	strcpy(hostname,argv[1]);
 
+	{
+	  char *p;
+	  int n;
+
+	  if (NULL != (p = strchr(hostname, ':')) && 0 < (n = atoi(p + 1))) {
+	    port = n;
+	    *p = '\0';
+	  }
+	}
+
 	get_commandline(argc, argv, dirname, rcfile,
                 &cleanup, &wait_after_articles, &wait_for_time, 
 		&command_flag, execute_command,
@@ -75,7 +87,7 @@
 			generateProcmailrc(homedir, rcfile, dirname, pipe_command);
 		}
 
-	socket_id=ConnectServer(hostname,119, 0);
+	socket_id=ConnectServer(hostname, port, 0);
 
 	/* two file descriptor are for portability among diff systems */
 	createFd(socket_id, socket_fp);