unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob a009efa297f359fc203d6657a6ae914ba307513b 878 bytes (raw)
name: gnu/packages/patches/netcat-openbsd-0003-get-sev-by-name.patch 	 # note: path name is non-authoritative(*)

 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
 
From: Aron Xu <aron@debian.org>
Date: Mon, 13 Feb 2012 14:45:08 +0800
Subject: get sev by name

---
 netcat.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/netcat.c b/netcat.c
index f3cc8c1..d912544 100644
--- a/netcat.c
+++ b/netcat.c
@@ -949,12 +949,19 @@ atelnet(int nfd, unsigned char *buf, unsigned int size)
 void
 build_ports(char *p)
 {
+        struct servent *sv;
 	const char *errstr;
 	char *n;
 	int hi, lo, cp;
 	int x = 0;

-	if ((n = strchr(p, '-')) != NULL) {
+        sv = getservbyname(p, uflag ? "udp" : "tcp");
+        if (sv) {
+                portlist[0] = calloc(1, PORT_MAX_LEN);
+                if (portlist[0] == NULL)
+                        err(1, NULL);
+                snprintf(portlist[0], PORT_MAX_LEN, "%d", ntohs(sv->s_port));
+        } else if ((n = strchr(p, '-')) != NULL) {
 		*n = '\0';
 		n++;

--

debug log:

solving 1d1cca8 ...
found 1d1cca8 in https://yhetil.org/guix-devel/20160622000749.GA27984@shadowwalker/

applying [1/1] https://yhetil.org/guix-devel/20160622000749.GA27984@shadowwalker/
diff --git a/gnu/packages/patches/netcat-openbsd-0003-get-sev-by-name.patch b/gnu/packages/patches/netcat-openbsd-0003-get-sev-by-name.patch
new file mode 100644
index 0000000..1d1cca8

1:24: space before tab in indent.
 	const char *errstr;
1:25: space before tab in indent.
 	char *n;
1:26: space before tab in indent.
 	int hi, lo, cp;
1:27: space before tab in indent.
 	int x = 0;
1:37: space before tab in indent.
 		*n = '\0';
Checking patch gnu/packages/patches/netcat-openbsd-0003-get-sev-by-name.patch...
Applied patch gnu/packages/patches/netcat-openbsd-0003-get-sev-by-name.patch cleanly.
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

skipping https://yhetil.org/guix-devel/20160622000749.GA27984@shadowwalker/ for 1d1cca8
index at:
100644 a009efa297f359fc203d6657a6ae914ba307513b	gnu/packages/patches/netcat-openbsd-0003-get-sev-by-name.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).