summaryrefslogtreecommitdiff
path: root/app-text/aha
diff options
context:
space:
mode:
Diffstat (limited to 'app-text/aha')
-rw-r--r--app-text/aha/Manifest4
-rw-r--r--app-text/aha/aha-0.5.1.ebuild20
-rw-r--r--app-text/aha/files/aha-0.5.1-null-ptr-dereference-fix.patch105
-rw-r--r--app-text/aha/metadata.xml20
4 files changed, 149 insertions, 0 deletions
diff --git a/app-text/aha/Manifest b/app-text/aha/Manifest
new file mode 100644
index 000000000000..f0ca0cb1e169
--- /dev/null
+++ b/app-text/aha/Manifest
@@ -0,0 +1,4 @@
+AUX aha-0.5.1-null-ptr-dereference-fix.patch 2937 BLAKE2B 6806292fa4e1c97fe620fa692e4d22e6e952f329aa95b70f00d80f25021cad3d352af529dd6b77a6dd3668fb8646b459c9ad1409afe7edd4b4d73e2837735912 SHA512 240066fc094214290cfb49f403cdf654e29b1e3574562f3fc749bfc49f9ce20dae997c538a826889ef2a7c481b1eefabdc5f0033f0f23271687eecb6031f4767
+DIST aha-0.5.1.tar.gz 394410 BLAKE2B 7276219068a8e496b41a953f4cdfc130b85778b44d194fedb63b0f0d921db0efcf0f62fae52ec580ac1462e3b03edd6ad97dab7d7ff2c138ef300824efbad111 SHA512 0eb88e681208c0956e344d6574f9d7ba155d38bfb386d0a9f17022c5e925fb16d0efb6aa04804191b4cac1697a87a0f16ba51bcd97b6135cc7606046eaf89288
+EBUILD aha-0.5.1.ebuild 482 BLAKE2B 69283b20e8b28c9b0816c1d3c0e23b34e28904e9c613e63de4db7325bebf5f28102ebb1b5edb3e06cb20d47edcf595738c80fa77921f0829c551db050b80ab16 SHA512 685bcdc840d455bbfed91c4aa1d808152f072ac5c00e5d690fbffaecb8110b8a87aa93fc015fb8a2721daec2b70a8eab744a1650bbf1137edd2501f1814788a4
+MISC metadata.xml 679 BLAKE2B 1e3f5288af1d2a30f9ad157f676c196642113faf28fe97db1de68d8d62ede2cf45b76b8f17aa33b52b3c3015f131f6063a107c9dab75108278f1d055c247c521 SHA512 dfdba86f3c0cc684ed4a74e0ebe715aa295b5f8acae000e86609ceddbe3ee3e87b8c5640b0c955a60e389eef8201d64a5799ddbf061cf47c5423030fba458b9a
diff --git a/app-text/aha/aha-0.5.1.ebuild b/app-text/aha/aha-0.5.1.ebuild
new file mode 100644
index 000000000000..2cb556e1e882
--- /dev/null
+++ b/app-text/aha/aha-0.5.1.ebuild
@@ -0,0 +1,20 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Converts ANSI escape sequences of a unix terminal to HTML code"
+HOMEPAGE="https://github.com/theZiz/aha"
+SRC_URI="https://github.com/theZiz/aha/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2+ MPL-1.1"
+SLOT="0"
+KEYWORDS="~amd64"
+
+PATCHES=(
+ "${FILESDIR}/${P}-null-ptr-dereference-fix.patch"
+)
+
+src_install() {
+ emake PREFIX="${D}/usr" install
+}
diff --git a/app-text/aha/files/aha-0.5.1-null-ptr-dereference-fix.patch b/app-text/aha/files/aha-0.5.1-null-ptr-dereference-fix.patch
new file mode 100644
index 000000000000..6ec2ca9cae1d
--- /dev/null
+++ b/app-text/aha/files/aha-0.5.1-null-ptr-dereference-fix.patch
@@ -0,0 +1,105 @@
+diff --git a/aha.c b/aha.c
+index 46e43c0..2bfebb7 100644
+--- a/aha.c
++++ b/aha.c
+@@ -138,6 +138,15 @@ pelem parseInsert(char* s)
+ return firstelem;
+ }
+
++int parseDepthAtLeast(pelem elem, unsigned int wanted) {
++ while (elem != NULL) {
++ if (wanted == 0) return 1;
++ elem = elem->next;
++ --wanted;
++ }
++ return 0;
++}
++
+ void deleteParse(pelem elem)
+ {
+ while (elem!=NULL)
+@@ -831,27 +840,20 @@ int main(int argc,char* args[])
+ }
+ else
+ if (momelem->value == 38 &&
+- momelem->next &&
+- momelem->next->value == 2 &&
+- momelem->next->next)// 38;2;<n> -> 24 Bit
++ parseDepthAtLeast(momelem, 4) &&
++ momelem->next->value == 2)// 38;2;<r>;<g>;<b> -> 24 Bit
+ {
+- momelem = momelem->next->next;
+- pelem r,g,b;
+- r = momelem;
+- momelem = momelem->next;
+- g = momelem;
+- if ( momelem )
+- momelem = momelem->next;
+- b = momelem;
+- if ( r && g && b )
+- {
+- state.highlighted = 0;
+- state.fc_colormode = MODE_24BIT;
+- *dest =
+- (r->value & 255) * 65536 +
+- (g->value & 255) * 256 +
+- (b->value & 255);
+- }
++ pelem r = momelem->next->next;
++ pelem g = r->next;
++ pelem b = g->next;
++ momelem = b;
++
++ state.highlighted = 0;
++ state.fc_colormode = MODE_24BIT;
++ *dest =
++ (r->value & 255) * 65536 +
++ (g->value & 255) * 256 +
++ (b->value & 255);
+ }
+ else
+ {
+@@ -899,27 +901,20 @@ int main(int argc,char* args[])
+ }
+ else
+ if (momelem->value == 48 &&
+- momelem->next &&
+- momelem->next->value == 2 &&
+- momelem->next->next)// 48;2;<n> -> 24 Bit
++ parseDepthAtLeast(momelem, 4) &&
++ momelem->next->value == 2)// 48;2;<r>;<g>;<b> -> 24 Bit
+ {
+- momelem = momelem->next->next;
+- pelem r,g,b;
+- r = momelem;
+- momelem = momelem->next;
+- g = momelem;
+- if ( momelem )
+- momelem = momelem->next;
+- b = momelem;
+- if ( r && g && b )
+- {
+- state.bc_colormode = MODE_24BIT;
+- state.highlighted = 0;
+- *dest =
+- (r->value & 255) * 65536 +
+- (g->value & 255) * 256 +
+- (b->value & 255);
+- }
++ pelem r = momelem->next->next;
++ pelem g = r->next;
++ pelem b = g->next;
++ momelem = b;
++
++ state.bc_colormode = MODE_24BIT;
++ state.highlighted = 0;
++ *dest =
++ (r->value & 255) * 65536 +
++ (g->value & 255) * 256 +
++ (b->value & 255);
+ }
+ else
+ {
+--
+2.35.1
+
diff --git a/app-text/aha/metadata.xml b/app-text/aha/metadata.xml
new file mode 100644
index 000000000000..16118a3d4fa8
--- /dev/null
+++ b/app-text/aha/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>zoltan@sinustrom.info</email>
+ <name>Zoltan Puskas</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription>
+ aha (ANSI HTML Adapter) converts ANSI colors to HTML, e.g. if you want
+ to publish the output of ls --color=yes, git diff, ccal or htop as
+ static HTML somewhere.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">theZiz/aha</remote-id>
+ </upstream>
+</pkgmetadata>