Репозитории ALT
Группа :: Разработка/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 */