-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhostcvt.pch2
121 lines (116 loc) · 3.53 KB
/
hostcvt.pch2
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Newsgroups: comp.sources.unix
From: [email protected] (Roger S. Southwick)
Subject: v26i017: hostcvt - convert /etc/hosts files into DNS zone files, Patch02
Sender: [email protected]
Approved: [email protected]
Submitted-By: [email protected] (Roger S. Southwick)
Posting-Number: Volume 26, Issue 17
Archive-Name: hostcvt.pch2
This is Official patch #2 for the hostcvt program (v25i093). This patch
adds a -S flag which strips out any domains from the hostnames found in the
input host file. Also, this patch corrects my E-mail address in the 2 man
pages and README file.
Feed this to the stdin of Larry Wall's fine patch program (I've tested with
patch version 2.0.1.6 Patch level: 12) and enjoy the results.
-Roger ([email protected])
UUCP: ...!uunet!tektronix!Roger.S.Southwick
[email protected] (Roger S. Southwick)
Index: main.c
Prereq: 1.5
11c11
< static char *RCSid = "$Id: main.c,v 1.5 91/12/07 16:51:15 rogers Release $";
---
> static char *RCSid = "$Id: main.c,v 1.8 92/03/24 17:46:28 rogers Release $";
54c54
< char *strsave(), *malloc();
---
> char *strsave(), *malloc(), *index(), *strcpy();
58c58
< register char *ipaddr, **cpp;
---
> register char *ipaddr, **cpp, *cp;
60a61,63
> char ch, buf[BUFSIZ];
> int hostflag, soaflag, netflag, errflag, outputflag;
> int domainflag, kflag, Sflag;
62,65c65,66
< char ch;
< int hostflag, soaflag, netflag, errflag, outputflag, domainflag, kflag;
<
< kflag = hostflag = soaflag = netflag = errflag = outputflag = domainflag = 0;
---
> Sflag = kflag = hostflag = soaflag = netflag = 0;
> errflag = outputflag = domainflag = 0;
69c70
< while ((ch = egetopt(argc, argv, "kh:n:o:s:")) != -1)
---
> while ((ch = egetopt(argc, argv, "Skh:n:o:s:")) != -1)
114a116,119
> case 'S': /* Strip out domains */
> Sflag++;
> break;
>
133c138
< (void) fprintf(stderr, "usage: hostcvt [-h hostsfile] [-n netlistfile]\n\t\t[-s soabasefile] [-o outputfile] domain\n");
---
> (void) fprintf(stderr, "usage: hostcvt [-k] [-S] [-h hostsfile] [-n netlistfile]\n\t\t[-s soabasefile] [-o outputfile] domain\n");
175a181,195
> if(Sflag){
> (void)strcpy(buf, hp->h_name);
> if((cp = index(buf, '.')) != NULL){
> *cp = '\0';
> hp->h_name = strsave(buf);
> }
> for (cpp = hp->h_aliases; *cpp != NULL; cpp++) {
> (void)strcpy(buf, *cpp);
> if((cp = index(buf, '.')) != NULL){
> *cp = '\0';
> *cpp = strsave(buf);
> }
> }
> }
>
Index: hostcvt.8
Prereq: 1.3
2c2
< .\" $Id: hostcvt.8,v 1.3 91/12/07 16:56:22 rogers Release $
---
> .\" $Id: hostcvt.8,v 1.5 92/03/24 17:40:29 rogers Release $
4c4
< .TH HOSTCVT 8 "10-3-90"
---
> .TH HOSTCVT 8 "03-24-92"
11a12,13
> .I -S
> ] [
62a65,67
> .BI \-S
> Strip any domain portion from the hostnames and aliases.
> .TP
205c210
---
Index: nextserial.8
Prereq: 1.1
2c2
< .\" $Id: nextserial.8,v 1.1 90/10/03 23:34:03 rogers Release $
---
> .\" $Id: nextserial.8,v 1.2 92/03/24 17:41:36 rogers Release $
65c65
---
Index: README
3c3
< No warrenty written or implied. You are free to use this program
---
> No warranty written or implied. You are free to use this program
10,12c10,12
< -Roger ([email protected])
< UUCP: ...!uunet!tektronix!amadeus.wr.tek.com!rogers
< ARPA: <@RELAY.CS.NET:[email protected]>
---
> -Roger ([email protected])
> UUCP: ...!uunet!tektronix!Roger.S.Southwick
>