Accepting request 64202 from shells

Accepted submit request 64202 from user namtrac

OBS-URL: https://build.opensuse.org/request/show/64202
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/zsh?expand=0&rev=24
This commit is contained in:
Sascha Peilicke 2011-03-16 10:21:24 +00:00 committed by Git OBS Bridge
commit daa456dc3f
3 changed files with 43 additions and 0 deletions

36
subst-crash.patch Normal file
View File

@ -0,0 +1,36 @@
From aa58d139ff3ffa7258a6273bf279d70f9ee31916 Mon Sep 17 00:00:00 2001
From: Peter Stephenson <pws@users.sourceforge.net>
Date: Tue, 18 Jan 2011 10:29:58 +0000
Subject: [PATCH] Mikael: 28637: ${foo:0:} caused crash
---
ChangeLog | 6 +++++-
Src/subst.c | 14 ++++++++------
Test/D04parameter.ztst | 5 +++++
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/Src/subst.c b/Src/subst.c
index 24d515d..37d63ca 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -2814,12 +2814,14 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
zerr("invalid length: %s", check_offset);
return NULL;
}
- length = mathevali(check_offset);
- if (errflag)
- return NULL;
- if (length < (zlong)0) {
- zerr("invalid length: %s", check_offset);
- return NULL;
+ if (check_offset) {
+ length = mathevali(check_offset);
+ if (errflag)
+ return NULL;
+ if (length < (zlong)0) {
+ zerr("invalid length: %s", check_offset);
+ return NULL;
+ }
}
}
if (horrible_offset_hack) {

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Mar 15 13:40:24 UTC 2011 - ismail@namtrac.org
- Fix crash with ${foo:0:}
-------------------------------------------------------------------
Wed Dec 29 02:07:58 UTC 2010 - cristian.rodriguez@opensuse.org

View File

@ -46,6 +46,7 @@ Patch0: %{name}-%{version}-doc_makefile.patch
Patch1: %{name}-%{version}-doc_intro_paths.patch
Patch2: %{name}-%{version}-run-help_pager.patch
Patch3: zsh-cleanup.patch
Patch4: subst-crash.patch
Summary: Shell with comprehensive completion
%define do_profiling 0
@ -67,6 +68,7 @@ Authors:
%patch1
%patch2
%patch3
%patch4 -p1
# Fix bindir path in some files
perl -p -i -e 's|/usr/local/bin|%{_bindir}|' \
Functions/Misc/zcalc Functions/Example/cat \