mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-02 18:00:49 +02:00
commit bash-20050915 snapshot
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user