mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-13 07:00:49 +02:00
commit bash-20070802 snapshot
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* histexpand.c -- history expansion. */
|
||||
|
||||
/* Copyright (C) 1989-2004 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1989-2007 Free Software Foundation, Inc.
|
||||
|
||||
This file contains the GNU History Library (the Library), a set of
|
||||
routines for managing the text of previously typed lines.
|
||||
@@ -66,6 +66,7 @@ static int subst_rhs_len;
|
||||
static char *get_history_word_specifier PARAMS((char *, char *, int *));
|
||||
static char *history_find_word PARAMS((char *, int));
|
||||
static int history_tokenize_word PARAMS((const char *, int));
|
||||
static char **history_tokenize_internal PARAMS((const char *, int, int *));
|
||||
static char *history_substring PARAMS((const char *, int, int));
|
||||
|
||||
static char *quote_breaks PARAMS((char *));
|
||||
@@ -1582,7 +1583,10 @@ history_find_word (line, ind)
|
||||
|
||||
words = history_tokenize_internal (line, ind, &wind);
|
||||
if (wind == -1 || words == 0)
|
||||
return ((char *)NULL);
|
||||
{
|
||||
FREE (words);
|
||||
return ((char *)NULL);
|
||||
}
|
||||
s = words[wind];
|
||||
for (i = 0; i < wind; i++)
|
||||
free (words[i]);
|
||||
|
||||
+3
-1
@@ -1,6 +1,6 @@
|
||||
/* util.c -- readline utility functions */
|
||||
|
||||
/* Copyright (C) 1987-2005 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1987-2007 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU Readline Library, a library for
|
||||
reading lines of text with interactive input and history editing.
|
||||
@@ -185,6 +185,7 @@ rl_tilde_expand (ignore, key)
|
||||
{
|
||||
homedir = tilde_expand ("~");
|
||||
_rl_replace_text (homedir, start, end);
|
||||
xfree (homedir);
|
||||
return (0);
|
||||
}
|
||||
else if (rl_line_buffer[start] != '~')
|
||||
@@ -215,6 +216,7 @@ rl_tilde_expand (ignore, key)
|
||||
xfree (temp);
|
||||
|
||||
_rl_replace_text (homedir, start, end);
|
||||
xfree (homedir);
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
||||
Reference in New Issue
Block a user