about summary refs log tree commit diff
path: root/Src/subst.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-01-18 10:29:58 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-01-18 10:29:58 +0000
commitaa58d139ff3ffa7258a6273bf279d70f9ee31916 (patch)
treeb0835cc3411f8689289c8c6acd868f78c611685a /Src/subst.c
parent931a3b6405c28d72ae609703ce63c3e6fdbd8655 (diff)
downloadzsh-aa58d139ff3ffa7258a6273bf279d70f9ee31916.tar.gz
zsh-aa58d139ff3ffa7258a6273bf279d70f9ee31916.tar.xz
zsh-aa58d139ff3ffa7258a6273bf279d70f9ee31916.zip
Mikael: 28637: ${foo:0:} caused crash
Diffstat (limited to 'Src/subst.c')
-rw-r--r--Src/subst.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 24d515d06..37d63cabe 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) {