commit bash-20050915 snapshot

This commit is contained in:
Chet Ramey
2011-12-03 13:51:07 -05:00
parent a2e7f35864
commit 66e6d7cffd
14 changed files with 2949 additions and 1047 deletions
+31
View File
@@ -12087,3 +12087,34 @@ doc/bashref.texi
builtins/mkbuiltins.c
- change to not generate N_(""), because the translated empty string is
special to GNU gettext
9/13
----
lib/readline/complete.c
- a negative value for rl_completion_query_items means to not ask
lib/readline/doc/{{rltech,rluser}.texi,readline.3}
- documented new semantics for rl_completion_query_items/
completion-query-items
9/14
----
bashline.c
- bind M-TAB in emacs mode to dynamic-complete-history even if the
current binding is `tab-insert' (which is what it is by default),
not just if it's unbound
9/15
----
eval.c
- call QUIT before calling dispose_command on current_command after
the `exec_done' label. If we dispose current_command first, the
longjmp might restore the value of current_command after we've
disposed it, and the subsequent call to dispose_command from the
DISCARD case will free memory twice
9/16
----
lib/sh/strto[iu]max.c
- make sure the function being declared is not a cpp define before
defining it -- should fix problems on HP-UX
+31
View File
@@ -12081,3 +12081,34 @@ builtins/echo.def
doc/bashref.texi
- describe the --enable-strict-posix-default option to configure
9/10
----
builtins/mkbuiltins.c
- change to not generate N_(""), because the translated empty string is
special to GNU gettext
9/13
----
lib/readline/complete.c
- a negative value for rl_completion_query_items means to not ask
lib/readline/doc/{{rltech,rluser}.texi,readline.3}
- documented new semantics for rl_completion_query_items/
completion-query-items
9/14
----
bashline.c
- bind M-TAB in emacs mode to dynamic-complete-history even if the
current binding is `tab-insert' (which is what it is by default),
not just if it's unbound
9/15
----
eval.c
- call QUIT before calling dispose_command on current_command after
the `exec_done' label. If we dispose current_command first, the
longjmp might restore the value of current_command after we've
disposed it, and the subsequent call to dispose_command from the
DISCARD case will free memory twice
+5 -1
View File
@@ -449,7 +449,11 @@ initialize_readline ()
#endif /* SPECIFIC_COMPLETION_FUNCTIONS */
rl_bind_key_if_unbound_in_map (TAB, dynamic_complete_history, emacs_meta_keymap);
kseq[0] = TAB;
kseq[1] = '\0';
func = rl_function_of_keyseq (kseq, emacs_meta_keymap, (int *)NULL);
if (func == 0 || func == rl_tab_insert)
rl_bind_key_in_map (TAB, dynamic_complete_history, emacs_meta_keymap);
/* Tell the completer that we want a crack first. */
rl_attempted_completion_function = attempt_shell_completion;
+2 -2
View File
@@ -146,13 +146,13 @@ reader_loop ()
execute_command (current_command);
exec_done:
QUIT;
if (current_command)
{
dispose_command (current_command);
current_command = (COMMAND *)NULL;
}
QUIT;
}
}
else
+3 -2
View File
@@ -208,7 +208,8 @@ int rl_completion_type = 0;
/* Up to this many items will be displayed in response to a
possible-completions call. After that, we ask the user if
she is sure she wants to see them all. */
she is sure she wants to see them all. A negative value means
don't ask. */
int rl_completion_query_items = 100;
int _rl_page_completions = 1;
@@ -1411,7 +1412,7 @@ display_matches (matches)
/* If there are many items, then ask the user if she really wants to
see them all. */
if (len >= rl_completion_query_items)
if (rl_completion_query_items > 0 && len >= rl_completion_query_items)
{
rl_crlf ();
fprintf (rl_outstream, "Display all %d possibilities? (y or n)", len);
+3 -3
View File
@@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet@ins.CWRU.Edu
.\"
.\" Last Change: Sat Aug 27 13:29:08 EDT 2005
.\" Last Change: Tue Sep 13 12:07:26 EDT 2005
.\"
.TH READLINE 3 "2005 Aug 27" "GNU Readline 5.1-alpha1"
.TH READLINE 3 "2005 Sep 13" "GNU Readline 5.1-alpha1"
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
@@ -369,7 +369,7 @@ It may be set to any integer value greater than or equal to
zero. If the number of possible completions is greater than
or equal to the value of this variable, the user is asked whether
or not he wishes to view them; otherwise they are simply listed
on the terminal.
on the terminal. A negative value causes readline to never ask.
.TP
.B convert\-meta (On)
If set to \fBOn\fP, readline will convert characters with the
+4 -3
View File
@@ -931,7 +931,7 @@ Restore the local Readline prompt display state saved by the most
recent call to @code{rl_save_prompt}.
if @code{rl_save_prompt} was called to save the prompt before a call
to @code{rl_message}, this function should be called before the
corresponding call to @coode{rl_clear_message}.
corresponding call to @code{rl_clear_message}.
@end deftypefun
@deftypefun int rl_expand_prompt (char *prompt)
@@ -1716,8 +1716,9 @@ shell variables and hostnames.
@deftypevar int rl_completion_query_items
Up to this many items will be displayed in response to a
possible-completions call. After that, we ask the user if she is sure
she wants to see them all. The default value is 100.
possible-completions call. After that, readline asks the user if she is sure
she wants to see them all. The default value is 100. A negative value
indicates that Readline should never ask the user.
@end deftypevar
@deftypevar {int} rl_completion_append_character
+1
View File
@@ -433,6 +433,7 @@ If the number of possible completions is greater than this value,
Readline will ask the user whether or not he wishes to view
them; otherwise, they are simply listed.
This variable must be set to an integer value greater than or equal to 0.
A negative value means Readline should never ask.
The default limit is @code{100}.
@item convert-meta
+5 -5
View File
@@ -2,9 +2,9 @@
Copyright (C) 1988-2005 Free Software Foundation, Inc.
@end ignore
@set EDITION 5.1-devel
@set VERSION 5.1-devel
@set UPDATED 27 August 2005
@set UPDATED-MONTH August 2005
@set EDITION 5.1-alpha1
@set VERSION 5.1-alpha1
@set UPDATED 13 September 2005
@set UPDATED-MONTH September 2005
@set LASTCHANGE Sat Aug 27 13:28:14 EDT 2005
@set LASTCHANGE Tue Sep 13 12:07:16 EDT 2005
+5 -1
View File
@@ -1,5 +1,5 @@
/* Convert string representation of a number into an intmax_t value.
Copyright 1999, 2001 Free Software Foundation, Inc.
Copyright 1999-2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -48,6 +48,10 @@ extern long strtol __P((const char *, char **, int));
extern long long strtoll __P((const char *, char **, int));
#endif
#ifdef strtoimax
#undef strtoimax
#endif
intmax_t
strtoimax (ptr, endptr, base)
const char *ptr;
+102
View File
@@ -0,0 +1,102 @@
/* Convert string representation of a number into an intmax_t value.
Copyright 1999, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Paul Eggert. Modified by Chet Ramey for Bash. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include <stdc.h>
/* Verify a requirement at compile-time (unlike assert, which is runtime). */
#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
#ifndef HAVE_DECL_STRTOL
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_STRTOL
extern long strtol __P((const char *, char **, int));
#endif
#ifndef HAVE_DECL_STRTOLL
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_STRTOLL && HAVE_LONG_LONG
extern long long strtoll __P((const char *, char **, int));
#endif
intmax_t
strtoimax (ptr, endptr, base)
const char *ptr;
char **endptr;
int base;
{
#if HAVE_LONG_LONG
verify(size_is_that_of_long_or_long_long,
(sizeof (intmax_t) == sizeof (long) ||
sizeof (intmax_t) == sizeof (long long)));
if (sizeof (intmax_t) != sizeof (long))
return (strtoll (ptr, endptr, base));
#else
verify (size_is_that_of_long, sizeof (intmax_t) == sizeof (long));
#endif
return (strtol (ptr, endptr, base));
}
#ifdef TESTING
# include <stdio.h>
int
main ()
{
char *p, *endptr;
intmax_t x;
#if HAVE_LONG_LONG
long long y;
#endif
long z;
printf ("sizeof intmax_t: %d\n", sizeof (intmax_t));
#if HAVE_LONG_LONG
printf ("sizeof long long: %d\n", sizeof (long long));
#endif
printf ("sizeof long: %d\n", sizeof (long));
x = strtoimax("42", &endptr, 10);
#if HAVE_LONG_LONG
y = strtoll("42", &endptr, 10);
#else
y = -1;
#endif
z = strtol("42", &endptr, 10);
printf ("%lld %lld %ld\n", x, y, z);
exit (0);
}
#endif
+5 -1
View File
@@ -1,5 +1,5 @@
/* Convert string representation of a number into an uintmax_t value.
Copyright 1999, 2001 Free Software Foundation, Inc.
Copyright 1999-2005 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -48,6 +48,10 @@ extern unsigned long strtoul __P((const char *, char **, int));
extern unsigned long long strtoull __P((const char *, char **, int));
#endif
#ifdef strtoumax
#undef strtoumax
#endif
uintmax_t
strtoumax (ptr, endptr, base)
const char *ptr;
+102
View File
@@ -0,0 +1,102 @@
/* Convert string representation of a number into an uintmax_t value.
Copyright 1999, 2001 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* Written by Paul Eggert. Modified by Chet Ramey for Bash. */
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include <stdc.h>
/* Verify a requirement at compile-time (unlike assert, which is runtime). */
#define verify(name, assertion) struct name { char a[(assertion) ? 1 : -1]; }
#ifndef HAVE_DECL_STRTOUL
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_STRTOUL
extern unsigned long strtoul __P((const char *, char **, int));
#endif
#ifndef HAVE_DECL_STRTOULL
"this configure-time declaration test was not run"
#endif
#if !HAVE_DECL_STRTOULL && HAVE_UNSIGNED_LONG_LONG
extern unsigned long long strtoull __P((const char *, char **, int));
#endif
uintmax_t
strtoumax (ptr, endptr, base)
const char *ptr;
char **endptr;
int base;
{
#if HAVE_UNSIGNED_LONG_LONG
verify (size_is_that_of_unsigned_long_or_unsigned_long_long,
(sizeof (uintmax_t) == sizeof (unsigned long) ||
sizeof (uintmax_t) == sizeof (unsigned long long)));
if (sizeof (uintmax_t) != sizeof (unsigned long))
return (strtoull (ptr, endptr, base));
#else
verify (size_is_that_of_unsigned_long, sizeof (uintmax_t) == sizeof (unsigned long));
#endif
return (strtoul (ptr, endptr, base));
}
#ifdef TESTING
# include <stdio.h>
int
main ()
{
char *p, *endptr;
uintmax_t x;
#if HAVE_UNSIGNED_LONG_LONG
unsigned long long y;
#endif
unsigned long z;
printf ("sizeof uintmax_t: %d\n", sizeof (uintmax_t));
#if HAVE_UNSIGNED_LONG_LONG
printf ("sizeof unsigned long long: %d\n", sizeof (unsigned long long));
#endif
printf ("sizeof unsigned long: %d\n", sizeof (unsigned long));
x = strtoumax("42", &endptr, 10);
#if HAVE_LONG_LONG
y = strtoull("42", &endptr, 10);
#else
y = 0;
#endif
z = strtoul("42", &endptr, 10);
printf ("%llu %llu %lu\n", x, y, z);
exit (0);
}
#endif
+2650 -1029
View File
File diff suppressed because it is too large Load Diff