summaryrefslogtreecommitdiffstats
path: root/recipes/termcap/termcap-2.0.8/011_all_termcap-AAARGH.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/termcap/termcap-2.0.8/011_all_termcap-AAARGH.patch')
-rw-r--r--recipes/termcap/termcap-2.0.8/011_all_termcap-AAARGH.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/recipes/termcap/termcap-2.0.8/011_all_termcap-AAARGH.patch b/recipes/termcap/termcap-2.0.8/011_all_termcap-AAARGH.patch
new file mode 100644
index 0000000000..1ba98a0065
--- /dev/null
+++ b/recipes/termcap/termcap-2.0.8/011_all_termcap-AAARGH.patch
@@ -0,0 +1,57 @@
+--- termcap-2.0.8/termcap.c.aaargh
++++ termcap-2.0.8/termcap.c
+@@ -469,10 +469,12 @@
+ if (is_malloced && term_entry) free(term_entry);
+
+ /* Do we already have a buffer? */
+- if (sp) {
+- maxlen = tgetent_bufsize - 1;
+- is_malloced = 0;
+- } else {
++ /* No we don't. I don't care if they pass us a few gigabytes
++ * of storage. We're ignoring it. */
++ /* if (sp) {
++ * maxlen = tgetent_bufsize - 1;
++ * is_malloced = 0;
++ * } else { */
+ /* Count how many bytes we need. */
+ count = strlen(s) + 1;
+ for(i = l; i; i = i->next)
+@@ -483,7 +485,7 @@
+ sp = xmalloc(count);
+ maxlen = count + 32; /* Just a lot. */
+ is_malloced = 1;
+- }
++/* } */
+
+ /* Save buffer into static variable (yuk!) */
+ term_entry = sp;
+@@ -587,14 +589,16 @@
+ s = find_cap(term_entry, cap, '=');
+ if (s == NULL) return(s);
+
++ /* Yawn. Let's ignore bufp, too. */
+ /* Where to put the result. */
+- if (bufp == (char **)NULL) {
++ /* if (bufp == (char **)NULL) { */
+ for(sp = s; *sp != ':' && *sp; sp++) {
+ if (*sp =='\\' && sp[1] == ':') sp++;
+ }
+ ret = xmalloc(sp - s + 1);
+- } else
+- ret = *bufp;
++ /* } else
++ * ret = *bufp;
++ */
+ r = ret;
+
+ /* Translate escaped characters and hat-notation. */
+@@ -628,7 +632,7 @@
+ *r++ = 0;
+
+ /* Do we need to update bufp? */
+- if (bufp) *bufp = r;
++ /* if (bufp) *bufp = r; */
+
+ return(ret);
+ }