summaryrefslogtreecommitdiff
path: root/app-text/discount/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-05-14 00:01:24 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-05-14 00:01:24 +0100
commit59c2499e0c9720169c9d5a02168c51c807a21467 (patch)
tree48c68a8a7e0094b2edaace12850e6c059bc3636b /app-text/discount/files
parenta25cc082a26782e5d39ded4559c91ff11bc3c299 (diff)
gentoo auto-resync : 14:05:2024 - 00:01:24
Diffstat (limited to 'app-text/discount/files')
-rw-r--r--app-text/discount/files/discount-2.2.7c-C99-fix.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/app-text/discount/files/discount-2.2.7c-C99-fix.patch b/app-text/discount/files/discount-2.2.7c-C99-fix.patch
new file mode 100644
index 000000000000..b08d3d41f844
--- /dev/null
+++ b/app-text/discount/files/discount-2.2.7c-C99-fix.patch
@@ -0,0 +1,38 @@
+FROM: https://github.com/Orc/discount/issues/283
+FROM: Atri Bhattacharya <badshah400@gmail.com>
+
+--- a/main.c
++++ b/main.c
+@@ -100,14 +100,15 @@ free_it(char *object, void *ctx)
+ }
+
+ char *
+-external_codefmt(char *src, int len, char *lang)
++external_codefmt(const char *src, const int len, void *lang)
+ {
+ int extra = 0;
+ int i, x;
+ char *res;
++ char *ec_lang = (char *)lang;
+
+- if ( lang == 0 )
+- lang = "generic_code";
++ if ( ec_lang == 0 )
++ ec_lang = "generic_code";
+
+ for ( i=0; i < len; i++) {
+ if ( src[i] == '&' )
+@@ -117,11 +118,11 @@ external_codefmt(char *src, int len, cha
+ }
+
+ /* 80 characters for the format wrappers */
+- if ( (res = malloc(len+extra+80+strlen(lang))) ==0 )
++ if ( (res = malloc(len+extra+80+strlen(ec_lang))) ==0 )
+ /* out of memory? drat! */
+ return 0;
+
+- sprintf(res, "<pre><code class=\"%s\">\n", lang);
++ sprintf(res, "<pre><code class=\"%s\">\n", ec_lang);
+ x = strlen(res);
+ for ( i=0; i < len; i++ ) {
+ switch (src[i]) {