<commit_before>require 'formula'

class Tn5250 < Formula
  homepage 'http://tn5250.sourceforge.net/'
  url 'http://sourceforge.net/projects/tn5250/files/tn5250/0.17.4/tn5250-0.17.4.tar.gz'
  sha1 '2c84f03f798fd5095009d6798d1e6c0b29e48a75'

  def install
    system "./configure", "--disable-debug", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    system "make"
    system "make install"
    system "make clean"
  end
end<commit_msg>tn5250: add patch to fix segfault<commit_after>require 'formula'

class Tn5250 < Formula
  homepage 'http://tn5250.sourceforge.net/'
  url 'http://sourceforge.net/projects/tn5250/files/tn5250/0.17.4/tn5250-0.17.4.tar.gz'
  sha1 '2c84f03f798fd5095009d6798d1e6c0b29e48a75'

  # Fix segfault; reported here:
  # http://archive.midrange.com/linux5250/201207/msg00000.html
  def patches; DATA; end

  def install
    system "./configure", "--disable-debug", "--disable-dependency-tracking",
                          "--prefix=#{prefix}"
    system "make"
    system "make install"
  end
end

__END__
diff --git a/curses/cursesterm.c b/curses/cursesterm.c
index bf20f05..b9c394c 100644
--- a/curses/cursesterm.c
+++ b/curses/cursesterm.c
@@ -22,6 +22,9 @@
 #define _TN5250_TERMINAL_PRIVATE_DEFINED
 #include "tn5250-private.h"
 #include "cursesterm.h"
+#ifdef __APPLE__
+#include <term.h>
+#endif
 
 #ifdef USE_CURSES
 
diff --git a/curses/tn5250.c b/curses/tn5250.c
index 30a1627..67392b1 100644
--- a/curses/tn5250.c
+++ b/curses/tn5250.c
@@ -19,6 +19,7 @@
  */
 
 #include "tn5250-private.h"
+#include "cursesterm.h"
 
 Tn5250Session *sess = NULL;
 Tn5250Stream *stream = NULL;
{'fraction_non_alphanumeric': 0.14972611077297626, 'fraction_numerical': 0.12964090079123555, 'mean_word_length': 3.372340425531915, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6565571', 'n_tokens_mistral': 782, 'n_tokens_neox': 650, 'n_words': 112}