fix for completing quoted filenames with show-all-if-ambiguous set; avoid signed int overflow in intrand32

This commit is contained in:
Chet Ramey
2023-01-10 10:23:14 -05:00
parent 8fd8cd8f7b
commit 0647e53bd1
8 changed files with 83 additions and 18 deletions
+7 -9
View File
@@ -23,15 +23,6 @@
#include "stdc.h"
/* Function pointers can be declared as (Function *)foo. */
#if !defined (_FUNCTION_DEF)
# define _FUNCTION_DEF
typedef int Function ();
typedef void VFunction ();
typedef char *CPFunction (); /* no longer used */
typedef char **CPPFunction (); /* no longer used */
#endif /* _FUNCTION_DEF */
typedef int sh_cget_func_t (void); /* sh_ivoidfunc_t */
typedef int sh_cunget_func_t (int); /* sh_intfunc_t */
@@ -70,6 +61,12 @@ extern BUFFERED_STREAM **buffers;
extern int default_buffered_input;
extern int bash_input_fd_changed;
#undef beof
#undef berror
#define beof(bp) (((bp)->b_flag & B_EOF) != 0)
#define berror(bp) (((bp)->b_flag & B_ERROR) != 0)
#endif /* BUFFERED_INPUT */
typedef union {
@@ -122,6 +119,7 @@ extern int check_bash_input (int);
extern int duplicate_buffered_stream (int, int);
extern BUFFERED_STREAM *fd_to_buffered_stream (int);
extern BUFFERED_STREAM *set_buffered_stream (int, BUFFERED_STREAM *);
extern BUFFERED_STREAM *get_buffered_stream (int);
extern BUFFERED_STREAM *open_buffered_stream (char *);
extern void free_buffered_stream (BUFFERED_STREAM *);
extern int close_buffered_stream (BUFFERED_STREAM *);