summaryrefslogtreecommitdiff
path: root/cmd-line-utils
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.(none)>2007-06-04 16:42:42 +0200
committerunknown <msvensson@pilot.(none)>2007-06-04 16:42:42 +0200
commit1bf52d4735fded85e3412c1fff6f393c6fc50c36 (patch)
treeb766785bc20f902adef60929ade6ea0795e3a4b5 /cmd-line-utils
parente3a24797fdc7768cc457fa05a668be60580d7f7d (diff)
downloadmariadb-git-1bf52d4735fded85e3412c1fff6f393c6fc50c36.tar.gz
Bug#10218 Command line recall rolls into Segmentation Fault(coredump)'
- Declare 'tgoto' if not already declared in system header files. cmd-line-utils/libedit/el_term.h: Declare 'tgoto' if not already declared in system header files. Failing to declare it will cause the pointer returned to be truncated to 32-bit integer which is no a valid pointer - in most cases. configure.in: Add check to see if 'tgoto' is declared in system header files
Diffstat (limited to 'cmd-line-utils')
-rw-r--r--cmd-line-utils/libedit/el_term.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/cmd-line-utils/libedit/el_term.h b/cmd-line-utils/libedit/el_term.h
index 9e5588ee96f..00ca48e38e2 100644
--- a/cmd-line-utils/libedit/el_term.h
+++ b/cmd-line-utils/libedit/el_term.h
@@ -90,6 +90,16 @@ extern char* tgoto(const char*, int, int);
extern char* tgetstr(char*, char**);
#endif
+
+#if !HAVE_DECL_TGOTO
+/*
+ 'tgoto' is not declared in the system header files, this causes
+ problems on 64-bit systems. The function returns a 64 bit pointer
+ but caller see it as "int" and it's thus truncated to 32-bit
+*/
+extern char* tgoto(const char*, int, int);
+#endif
+
protected void term_move_to_line(EditLine *, int);
protected void term_move_to_char(EditLine *, int);
protected void term_clear_EOL(EditLine *, int);