1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Upgrade to libedit-2.9

BitKeeper/deleted/.del-readline.h~ac6080227e4b72fc:
  Delete: cmd-line-utils/libedit/readline/readline.h
This commit is contained in:
unknown
2005-04-21 12:06:46 +02:00
parent 7f0f4c5875
commit 948d88da93
42 changed files with 2857 additions and 1313 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hist.c,v 1.12 2003/01/21 18:40:23 christos Exp $ */
/* $NetBSD: hist.c,v 1.15 2003/11/01 23:36:39 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -15,11 +15,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
@ -36,14 +32,7 @@
* SUCH DAMAGE.
*/
#include "config.h"
#if !defined(lint) && !defined(SCCSID)
#if 0
static char sccsid[] = "@(#)hist.c 8.1 (Berkeley) 6/4/93";
#else
__RCSID("$NetBSD: hist.c,v 1.12 2003/01/21 18:40:23 christos Exp $");
#endif
#endif /* not lint && not SCCSID */
#include <config.h>
/*
* hist.c: History access functions
@ -157,7 +146,6 @@ hist_get(EditLine *el)
* process a history command
*/
protected int
/*ARGSUSED*/
hist_command(EditLine *el, int argc, const char **argv)
{
const char *str;
@ -167,7 +155,7 @@ hist_command(EditLine *el, int argc, const char **argv)
if (el->el_history.ref == NULL)
return (-1);
if (argc == 0 || strcmp(argv[0], "list") == 1) {
if (argc == 1 || strcmp(argv[1], "list") == 0) {
/* List history entries */
for (str = HIST_LAST(el); str != NULL; str = HIST_PREV(el))
@ -176,15 +164,15 @@ hist_command(EditLine *el, int argc, const char **argv)
return (0);
}
if (argc != 2)
if (argc != 3)
return (-1);
num = (int)strtol(argv[1], NULL, 0);
num = (int)strtol(argv[2], NULL, 0);
if (strcmp(argv[0], "size") == 0)
if (strcmp(argv[1], "size") == 0)
return history(el->el_history.ref, &ev, H_SETSIZE, num);
if (strcmp(argv[0], "unique") == 0)
if (strcmp(argv[1], "unique") == 0)
return history(el->el_history.ref, &ev, H_SETUNIQUE, num);
return -1;