summaryrefslogtreecommitdiff
path: root/debian/patches/0007-bashish-index-fix.diff
blob: 0b64c5b34589899d1291db55f963679312103173 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Crash fix from upstream:
  <http://www.zsh.org/mla/workers/2011/msg00076.html>


Index: pkg-zsh/Src/subst.c
===================================================================
--- pkg-zsh.orig/Src/subst.c	2011-03-09 10:25:56.000000000 +0100
+++ pkg-zsh/Src/subst.c	2011-03-09 10:25:59.000000000 +0100
@@ -2814,12 +2814,14 @@
 			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) {
Index: pkg-zsh/Test/D04parameter.ztst
===================================================================
--- pkg-zsh.orig/Test/D04parameter.ztst	2011-03-09 10:25:56.000000000 +0100
+++ pkg-zsh/Test/D04parameter.ztst	2011-03-09 10:25:59.000000000 +0100
@@ -1405,3 +1405,8 @@
    printf "%n" '[0]'
 1:Regression test for identifier test
 ?(eval):1: not an identifier: [0]
+
+   str=rts
+   print ${str:0:}
+1:Regression test for missing length after offset
+?(eval):2: unrecognized modifier