Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37814605
en ru br
Репозитории ALT
S:1.46-alt1
5.1: 1.19-alt1
4.1: 1.17a-alt1
4.0: 1.16-alt1
3.0: 1.15-alt1.1
www.altlinux.org/Changes

Группа :: Разработка/Perl
Пакет: perl-Term-ReadLine-Gnu

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: perl-Term-ReadLine-Gnu-1.37-at-xmalloc-at-curses.patch
Скачать


--- Term-ReadLine-Gnu-1.37/Gnu.xs	2021-02-10 14:43:45.000000000 +0000
+++ Term-ReadLine-Gnu-1.37/Gnu.xs	2021-02-10 14:52:23.067452779 +0000
@@ -29,6 +29,11 @@
 #include <readline/readline.h>
 #include <readline/history.h>
 
+/* for tputs and tgetstr */
+#undef instr
+#include <curses.h>
+#include <term.h>
+
 /*
  * Perl 5.005 requires an ANSI C Compiler.  Good news.
  * But I should still support legacy C compilers now.
@@ -390,18 +395,17 @@
  * utility/dummy functions
  */
 /* from GNU Readline:xmalloc.h */
-#ifndef PTR_T
-#ifdef __STDC__
-#  define PTR_T void *
-#else
-#  define PTR_T char *
-#endif
-#endif /* !PTR_T */
 
-/* from GNU Readline:xmalloc.c */
-extern PTR_T xmalloc PARAMS((int));
-extern char *tgetstr PARAMS((const char *, char **));
-extern int tputs PARAMS((const char *, int, int (*)(int)));
+static void *
+xmalloc(size_t n)
+{
+  void *p = malloc(n);
+  if (!p) {
+    perror("Term::ReadLine::Gnu: xmalloc");
+    abort();
+  }
+  return p;
+}
 
 /*
  * Using xfree() in GNU Readline Library causes problem with Solaris
@@ -410,13 +414,7 @@
  * I choose this as default since some other OSs may have same problem.
  * usemymalloc=n is required.
  */
-static void
-xfree (string)
-     PTR_T string;
-{
-  if (string)
-    free (string);
-}
+#define xfree(p) free(p)
 
 static char *
 dupstr(s)			/* duplicate string */
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin