diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 1999-05-28 01:59:23 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 1999-05-28 01:59:23 +0000 |
commit | f5b6c9d1edd4cd430eea9dfdf45288e2d6048a5e (patch) | |
tree | b727625e73f35f475e06719785a6f7a2d5126754 /contrib/libreadline/histexpand.c | |
parent | 91d01d1fdf0be5e6ac81f6fc42a05a1ee1c1ef05 (diff) | |
download | src-f5b6c9d1edd4cd430eea9dfdf45288e2d6048a5e.tar.gz src-f5b6c9d1edd4cd430eea9dfdf45288e2d6048a5e.zip |
readline v4.0
Notes
Notes:
svn path=/vendor/libreadline/dist/; revision=47558
Diffstat (limited to 'contrib/libreadline/histexpand.c')
-rw-r--r-- | contrib/libreadline/histexpand.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/contrib/libreadline/histexpand.c b/contrib/libreadline/histexpand.c index 0dc179ac7f65..392e6d38d9ec 100644 --- a/contrib/libreadline/histexpand.c +++ b/contrib/libreadline/histexpand.c @@ -365,6 +365,10 @@ hist_error(s, start, current, errtype) emsg = "unrecognized history modifier"; elen = 29; break; + case NO_PREV_SUBST: + emsg = "no previous substitution"; + elen = 24; + break; default: emsg = "unknown expansion error"; elen = 23; @@ -654,15 +658,6 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line) } } - /* If there is no lhs, the substitution can't succeed. */ - if (subst_lhs_len == 0) - { - *ret_string = hist_error (string, starting_index, i, SUBST_FAILED); - free (result); - free (temp); - return -1; - } - FREE (subst_rhs); subst_rhs = get_subst_pattern (string, &i, delimiter, 1, &subst_rhs_len); @@ -674,6 +669,15 @@ history_expand_internal (string, start, end_index_ptr, ret_string, current_line) else i += 2; + /* If there is no lhs, the substitution can't succeed. */ + if (subst_lhs_len == 0) + { + *ret_string = hist_error (string, starting_index, i, NO_PREV_SUBST); + free (result); + free (temp); + return -1; + } + l_temp = strlen (temp); /* Ignore impossible cases. */ if (subst_lhs_len > l_temp) |