mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-20 22:34:14 +08:00
Import readline 7.0 (patch 5)
This imports readline 7.0 (up to patch 5) while preserving all gdb-local changes. This was done by checking out the readline git repository, making a branch based on the gdb baseline revision, applying the gdb changes to that branch, and then merging from readline 7. readline/ChangeLog.gdb 2019-08-12 Tom Tromey <tom@tromey.com> * Imported readline 7.0 patch 5.
This commit is contained in:
29
readline/examples/rlbasic.c
Normal file
29
readline/examples/rlbasic.c
Normal file
@ -0,0 +1,29 @@
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined (READLINE_LIBRARY)
|
||||
# include "readline.h"
|
||||
# include "history.h"
|
||||
#else
|
||||
# include <readline/readline.h>
|
||||
# include <readline/history.h>
|
||||
#endif
|
||||
|
||||
int
|
||||
main (int c, char **v)
|
||||
{
|
||||
char *input;
|
||||
|
||||
for (;;) {
|
||||
input = readline ((char *)NULL);
|
||||
if (input == 0)
|
||||
break;
|
||||
printf ("%s\n", input);
|
||||
if (strcmp (input, "exit") == 0)
|
||||
break;
|
||||
free (input);
|
||||
}
|
||||
exit (0);
|
||||
}
|
Reference in New Issue
Block a user