dot

packages and services management
Log | Files | Refs | README

commit 7d82c4ceb9796e9da4b8f78312540713151f4a02
parent e95a4a2899b41c912c7f64ab152e095657e52efd
Author: Josuah Demangeon <mail@josuah.net>
Date:   Mon,  2 Apr 2018 15:39:27 +0200

patch is upstream

Diffstat:
Abin/rfc | 22++++++++++++++++++++++
Dpack/quark/0001-fix-segfault-on-parsing-of-v-and-m.patch | 37-------------------------------------
Mpack/quark/build | 2--
3 files changed, 22 insertions(+), 39 deletions(-)

diff --git a/bin/rfc b/bin/rfc @@ -0,0 +1,22 @@ +#!/bin/sh -e + +# from a rfc number: fetch, cleanup, open in pager + +# usage: rfc rfc#### +# rfc #### + +rfc="${1#rfc}" + +: ${rfc:?} + +mkdir -p "$HOME/var/rfc" +[ -f "$HOME/var/rfc/$rfc.txt" ] || + curl "https://tools.ietf.org/rfc/rfc$rfc.txt" | + awk ' + BEGIN { RS = ""; ORS = "\n\n"; } + /\x0c/ { n = 2; } + n > 0 { n--; next; } + { print; } + ' >"$HOME/var/rfc/$rfc.txt" + +exec $PAGER "$HOME/var/rfc/$rfc.txt" diff --git a/pack/quark/0001-fix-segfault-on-parsing-of-v-and-m.patch b/pack/quark/0001-fix-segfault-on-parsing-of-v-and-m.patch @@ -1,37 +0,0 @@ -From 1763adb36eaa8c62c862ab58072287348e94d326 Mon Sep 17 00:00:00 2001 -From: Josuah Demangeon <mail@josuah.net> -Date: Sat, 31 Mar 2018 18:57:50 +0200 -Subject: [PATCH] fix segfault on parsing of -v and -m - -the length is initially 0 so it needs to be incremented before -reallocarray to avoid *alloc(0); and keep some space for the element -to insert ---- - main.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/main.c b/main.c -index 9985d31..5f1c6d9 100644 ---- a/main.c -+++ b/main.c -@@ -166,7 +166,7 @@ main(int argc, char *argv[]) - if (!(tok = strdup(EARGF(usage())))) { - die("strdup:"); - } -- if (!(s.vhost = reallocarray(s.vhost, s.vhost_len++, -+ if (!(s.vhost = reallocarray(s.vhost, ++s.vhost_len, - sizeof(struct vhost)))) { - die("reallocarray:"); - } -@@ -182,7 +182,7 @@ main(int argc, char *argv[]) - if (!(tok = strdup(EARGF(usage())))) { - die("strdup:"); - } -- if (!(s.map = reallocarray(s.map, s.map_len++, -+ if (!(s.map = reallocarray(s.map, ++s.map_len, - sizeof(struct map)))) { - die("reallocarray:"); - } --- -2.10.0 - diff --git a/pack/quark/build b/pack/quark/build @@ -1,6 +1,4 @@ #!/bin/sh -ex -git apply "$PACK/quark/0001-fix-segfault-on-parsing-of-v-and-m.patch" || : - make make PREFIX="$PREFIX" install