mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-07 18:52:35 +02:00
Bash-5.2-rc1 release
This commit is contained in:
@@ -50,6 +50,8 @@ Copyright (C) 1999 Jeff Solomon
|
||||
#include <stdio.h>
|
||||
#include <termios.h> /* xxx - should make this more general */
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
#ifdef READLINE_LIBRARY
|
||||
# include "readline.h"
|
||||
#else
|
||||
@@ -104,6 +106,8 @@ main()
|
||||
{
|
||||
fd_set fds;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
|
||||
/* Adjust the terminal slightly before the handler is installed. Disable
|
||||
* canonical mode processing and set the input character time flag to be
|
||||
* non-blocking.
|
||||
|
||||
@@ -27,8 +27,11 @@
|
||||
# include <readline/history.h>
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
|
||||
@@ -7,9 +7,13 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <locale.h>
|
||||
|
||||
/* Standard readline include files. */
|
||||
#if defined (READLINE_LIBRARY)
|
||||
# include "readline.h"
|
||||
@@ -22,10 +26,19 @@
|
||||
extern int errno;
|
||||
|
||||
static void cb_linehandler (char *);
|
||||
static void signandler (int);
|
||||
|
||||
int running;
|
||||
int running, sigwinch_received;
|
||||
const char *prompt = "rltest$ ";
|
||||
|
||||
/* Handle SIGWINCH and window size changes when readline is not active and
|
||||
reading a character. */
|
||||
static void
|
||||
sighandler (int sig)
|
||||
{
|
||||
sigwinch_received = 1;
|
||||
}
|
||||
|
||||
/* Callback function called for each line when accept-line executed, EOF
|
||||
seen, or EOF character read. This sets a flag and returns; it could
|
||||
also call exit(3). */
|
||||
@@ -60,6 +73,11 @@ main (int c, char **v)
|
||||
fd_set fds;
|
||||
int r;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
|
||||
/* Handle SIGWINCH */
|
||||
signal (SIGWINCH, sighandler);
|
||||
|
||||
/* Install the line handler. */
|
||||
rl_callback_handler_install (prompt, cb_linehandler);
|
||||
|
||||
@@ -80,6 +98,13 @@ main (int c, char **v)
|
||||
rl_callback_handler_remove ();
|
||||
break;
|
||||
}
|
||||
if (sigwinch_received)
|
||||
{
|
||||
rl_resize_terminal ();
|
||||
sigwinch_received = 0;
|
||||
}
|
||||
if (r < 0)
|
||||
continue;
|
||||
|
||||
if (FD_ISSET (fileno (rl_instream), &fds))
|
||||
rl_callback_read_char ();
|
||||
|
||||
@@ -38,6 +38,10 @@
|
||||
extern void exit();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
#if defined (READLINE_LIBRARY)
|
||||
# include "posixstat.h"
|
||||
# include "readline.h"
|
||||
@@ -93,6 +97,10 @@ main (argc, argv)
|
||||
else
|
||||
progname++;
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale (LC_ALL, "");
|
||||
#endif
|
||||
|
||||
/* defaults */
|
||||
prompt = "readline$ ";
|
||||
fd = nch = 0;
|
||||
|
||||
@@ -45,6 +45,10 @@
|
||||
extern void exit();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
@@ -79,6 +83,10 @@ main (argc, argv)
|
||||
char *temp;
|
||||
int opt, Vflag, Nflag;
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale (LC_ALL, ""):
|
||||
#endif
|
||||
|
||||
progname = strrchr(argv[0], '/');
|
||||
if (progname == 0)
|
||||
progname = argv[0];
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
extern void exit();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LOCALE_H
|
||||
# include <locale.h>
|
||||
#endif
|
||||
|
||||
#ifdef READLINE_LIBRARY
|
||||
# include "readline.h"
|
||||
# include "history.h"
|
||||
@@ -52,6 +56,10 @@ main ()
|
||||
char *temp, *prompt;
|
||||
int done;
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
setlocale (LC_ALL, "");
|
||||
#endif
|
||||
|
||||
temp = (char *)NULL;
|
||||
prompt = "readline$ ";
|
||||
done = 0;
|
||||
|
||||
Reference in New Issue
Block a user