update to latest upstream release: 5.4.1

This commit is contained in:
Kamil Dudka 2017-08-09 16:33:34 +02:00
parent 0f6b2f98a0
commit 0facfde4f6
4 changed files with 20 additions and 76 deletions

View File

@ -1,72 +0,0 @@
From e56d3b33b50c42301925288af98b18aeb56f83cc Mon Sep 17 00:00:00 2001
From: Peter Stephenson <pws@zsh.org>
Date: Fri, 6 Jan 2017 17:42:13 +0000
Subject: [PATCH] 40285: Be more careful with pattern allocation in history
isearch.
If there are ZLE hooks to be called, they may use patterns, in
which case it's not safe to allocate the isearch pattern in the
static buffer.
Upstream-commit: 48cadf48ff9c61ce09e826ad9a58e250e999a262
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
Src/Zle/zle_hist.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index abd6e17..434735d 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -1220,13 +1220,12 @@ doisearch(char **args, int dir, int pattern)
char *patbuf = ztrdup(sbuf);
char *patstring;
/*
- * Use static pattern buffer since we don't need
- * to maintain it and won't call other pattern functions
- * meanwhile.
+ * Do not use static pattern buffer (PAT_STATIC) since we call zle hooks,
+ * which might call other pattern functions. Use PAT_ZDUP instead.
* Use PAT_NOANCH because we don't need the match
* anchored to the end, even if it is at the start.
*/
- int patflags = PAT_STATIC|PAT_NOANCH;
+ int patflags = PAT_ZDUP|PAT_NOANCH;
if (sbuf[0] == '^') {
/*
* We'll handle the anchor later when
@@ -1521,6 +1520,7 @@ doisearch(char **args, int dir, int pattern)
if (only_one || !top_spot || old_sbptr != sbptr)
break;
}
+ freepatprog(patprog);
patprog = NULL;
nosearch = 1;
skip_pos = 0;
@@ -1632,6 +1632,7 @@ doisearch(char **args, int dir, int pattern)
}
strcpy(sbuf + sbptr, paste);
sbptr += pastelen;
+ freepatprog(patprog);
patprog = NULL;
free(paste);
} else if (cmd == Th(z_acceptsearch)) {
@@ -1682,6 +1683,7 @@ doisearch(char **args, int dir, int pattern)
* always valid at this point.
*/
sbptr += zlecharasstring(LASTFULLCHAR, sbuf + sbptr);
+ freepatprog(patprog);
patprog = NULL;
}
if (feep)
@@ -1702,6 +1704,7 @@ doisearch(char **args, int dir, int pattern)
zsfree(okeymap);
if (matchlist)
freematchlist(matchlist);
+ freepatprog(patprog);
isearch_active = 0;
/*
* Don't allow unused characters provided as a string to the
--
2.9.4

View File

@ -1 +1 @@
SHA512 (zsh-5.3.1.tar.xz) = 25f723c76d2779c3cb53de2e0dbb1163ec289f76282bec49757880d0ce32bf64a001a6b40c54c290d342aa09f92319af5c597bff99de8dbd1fc895c11836f304 SHA512 (zsh-5.4.1.tar.xz) = c666c54b05e2707e3a3cf9a87a17863792f0c89ec14f5fdc85a3064f26249cfba42a2953bc76bb90205fb87a08c203a165a5240c9fd6c489c13d8cc82ee6e979

11
zsh-5.4.1.tar.xz.asc Normal file
View File

@ -0,0 +1,11 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAABCAAGBQJZif8QAAoJEKcdmp1L2yezOv4H/iO2qf0EZPBIb1Yq2qC1DRYI
6EaqaBkNTHCExURqSW66WzSZkuwv2brtPuzLjFkqmZrWsoW/w5xEKSfsuxfGpQ+c
PvLvXH7rxHGARazUYC1IMFO0WTXnS9Ucrs4k0b6xruKs88M/nD74C8syhaKaPx9/
Gl/kXjBZWLQsIzJdUCVmo04Y2Xdob9XFwMsRA0tNTw0a5qoMJiMvKt866bwvVUrQ
i/YxcPsIuKBN9llTyjf/EpF2X+SdYw99/ZT0RV60srd949CIG9itAOy5NhC8HeTD
Ici7iOQcDdi0LO0qPeKmnN4Y7DCX2SYyCVAETMykQaIOcol9m/KBTo3CtBExw2I=
=h8ZF
-----END PGP SIGNATURE-----

View File

@ -1,7 +1,7 @@
Summary: Powerful interactive shell Summary: Powerful interactive shell
Name: zsh Name: zsh
Version: 5.3.1 Version: 5.4.1
Release: 12%{?dist} Release: 1%{?dist}
License: MIT License: MIT
URL: http://zsh.sourceforge.net/ URL: http://zsh.sourceforge.net/
Source0: https://www.zsh.org/pub/%{name}-%{version}.tar.xz Source0: https://www.zsh.org/pub/%{name}-%{version}.tar.xz
@ -11,7 +11,6 @@ Source3: zprofile.rhs
Source4: zshrc.rhs Source4: zshrc.rhs
Source5: zshenv.rhs Source5: zshenv.rhs
Source6: dotzshrc Source6: dotzshrc
Patch1: 0001-zsh-5.3.1-hist-isearch.patch
BuildRequires: coreutils BuildRequires: coreutils
BuildRequires: gawk BuildRequires: gawk
@ -29,6 +28,9 @@ Requires(postun): coreutils grep
# the hostname package is not available on RHEL-6 # the hostname package is not available on RHEL-6
%if 12 < 0%{?fedora} || 6 < 0%{?rhel} %if 12 < 0%{?fedora} || 6 < 0%{?rhel}
BuildRequires: hostname BuildRequires: hostname
%else
# /bin and /usr/bin are separate directories on RHEL-6
%define _bindir /bin
%endif %endif
Provides: /bin/zsh Provides: /bin/zsh
@ -166,6 +168,9 @@ fi
%doc Doc/*.html %doc Doc/*.html
%changelog %changelog
* Wed Aug 09 2017 Kamil Dudka <kdudka@redhat.com> - 5.4.1-1
- update to latest upstream release
* Tue Aug 01 2017 Kamil Dudka <kdudka@redhat.com> - 5.3.1-12 * Tue Aug 01 2017 Kamil Dudka <kdudka@redhat.com> - 5.3.1-12
- use %%make_install instead of %%makeinstall, which is deprecated - use %%make_install instead of %%makeinstall, which is deprecated
- modernize spec file (Group tag, %%clean, %%defattr) - modernize spec file (Group tag, %%clean, %%defattr)