about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-08-01 14:48:28 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-08-01 14:48:28 +0000
commit61e68d70da5af5afe943f92cd94a8c96e78348d9 (patch)
tree1e88adbfc21452caedcb57af2880097a349f44e6 /Src
parent14810d6df13e0564a606b74e4c4e918e80862e25 (diff)
downloadzsh-61e68d70da5af5afe943f92cd94a8c96e78348d9.tar.gz
zsh-61e68d70da5af5afe943f92cd94a8c96e78348d9.tar.xz
zsh-61e68d70da5af5afe943f92cd94a8c96e78348d9.zip
Diffstat (limited to 'Src')
-rw-r--r--Src/Zle/comp1.export3
-rw-r--r--Src/Zle/zle.export2
-rw-r--r--Src/Zle/zle_tricky.c17
-rw-r--r--Src/glob.c2
-rw-r--r--Src/hist.c4
-rw-r--r--Src/zsh.export4
6 files changed, 18 insertions, 14 deletions
diff --git a/Src/Zle/comp1.export b/Src/Zle/comp1.export
index 4b6dd92fd..ba2f433b9 100644
--- a/Src/Zle/comp1.export
+++ b/Src/Zle/comp1.export
@@ -9,7 +9,6 @@ clwords
 clwpos
 clwsize
 cmatcher
-compcommand
 compcontext
 compctltab
 compcurrent
@@ -33,7 +32,6 @@ compoldins
 compparameter
 comppatinsert
 comppatmatch
-comppms
 compprefix
 compredirect
 compqiprefix
@@ -55,7 +53,6 @@ freecompctl
 getcpatptr
 incompctlfunc
 incompfunc
-instring
 makecomplistcallptr
 makecomplistctlptr
 makecompparamsptr
diff --git a/Src/Zle/zle.export b/Src/Zle/zle.export
index f63f45eb8..1e71e4bf3 100644
--- a/Src/Zle/zle.export
+++ b/Src/Zle/zle.export
@@ -27,8 +27,6 @@ lmatches
 menuacc
 menucmp
 menucomplete
-menucur
-menugrp
 minfo
 newkeymap
 nlnct
diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c
index 9c7a19d87..9f4fa0c93 100644
--- a/Src/Zle/zle_tricky.c
+++ b/Src/Zle/zle_tricky.c
@@ -568,6 +568,8 @@ acceptlast(void)
 	cs = minfo.pos + minfo.len + minfo.insc - (*(minfo.cur))->qisl;
 	if (cs < l)
 	    foredel(l - cs);
+	else if (cs > ll)
+	    cs = ll;
 	inststrlen(" ", 1, 1);
 	if (parpre)
 	    inststr(parpre);
@@ -2121,6 +2123,7 @@ abort_match(void)
 {
     free_cline(matchparts);
     free_cline(matchsubs);
+    matchparts = matchsubs = NULL;
 }
 
 /* This adds a new string in the static char buffer. The arguments are
@@ -2615,6 +2618,7 @@ comp_match(char *pfx, char *sfx, char *w, Comp cp,
 	    chuck(r);
 	/* We still break it into parts here, trying to build a sensible
 	 * cline list for these matches, too. */
+	w = dupstring(w);
 	wl = strlen(w);
 	*clp = bld_parts(w, wl, wl, NULL);
 	*exact = 0;
@@ -6280,8 +6284,8 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 			    gen_matches_files(1, 0, 0);
 			/* The compctl has a glob pattern (compctl -g). */
 			if (cc->glob) {
-			    int ns, pl = strlen(prpre), o;
-			    char *g = dupstring(cc->glob), pa[PATH_MAX];
+			    int ns, pl = strlen(prpre), o, paalloc;
+			    char *g = dupstring(cc->glob), *pa;
 			    char *p2, *p3;
 			    int ne = noerrs, md = opts[MARKDIRS];
 
@@ -6295,8 +6299,9 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 			    }
 			    noerrs = 1;
 			    addwhat = -6;
+			    o = strlen(prpre);
+			    pa = (char *)zalloc(paalloc = o + PATH_MAX);
 			    strcpy(pa, prpre);
-			    o = strlen(pa);
 			    opts[MARKDIRS] = 0;
 
 			    /* The compctl -g string may contain more than *
@@ -6335,6 +6340,10 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 				else {
 				/* It's a simple pattern, so append it to *
 				 * the path we have on the command line.  */
+				    int minlen = o + strlen(g);
+				    if (minlen >= paalloc)
+					pa = (char *)
+					    zrealloc(pa, paalloc = minlen+1);
 				    strcpy(pa + o, g);
 				    addlinknode(l, dupstring(pa));
 				}
@@ -6380,6 +6389,8 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd)
 			    glob_pre = glob_suf = NULL;
 			    noerrs = ne;
 			    opts[MARKDIRS] = md;
+
+			    zfree(pa, paalloc);
 			}
 		    }
 		    dirs++;
diff --git a/Src/glob.c b/Src/glob.c
index cf22ef923..20ca30b2e 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -3023,7 +3023,7 @@ matchonce(Comp c)
 			if (exclend) {
 			     exclsav = *exclend;
 			    *exclend = '\0';
-			 }
+			}
 			if ((ret = doesmatch(c->left))) {
 			    if (exclend)
 				*exclend = exclsav;
diff --git a/Src/hist.c b/Src/hist.c
index 167ffe171..52e3e1394 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -700,7 +700,7 @@ hbegin(int dohist)
 {
     isfirstln = isfirstch = 1;
     errflag = histdone = spaceflag = 0;
-    stophist = (dohist ? ((!interact || unset(SHINSTDIN)) << 1) : 2);
+    stophist = (!dohist || !interact || unset(SHINSTDIN)) ? 2 : 0;
     if (stophist == 2 || (inbufflags & INP_ALIAS)) {
 	chline = hptr = NULL;
 	hlinesz = 0;
@@ -721,6 +721,8 @@ hbegin(int dohist)
 	hwbegin = ihwbegin;
 	hwend = ihwend;
 	addtoline = iaddtoline;
+	if (!isset(BANGHIST))
+	    stophist = 4;
     }
     chwordpos = 0;
 
diff --git a/Src/zsh.export b/Src/zsh.export
index 5a3a94c70..59d75676f 100644
--- a/Src/zsh.export
+++ b/Src/zsh.export
@@ -76,7 +76,6 @@ file_type
 filesub
 filesubstr
 findcmd
-firsthist
 freearray
 freeheap
 freelinklist
@@ -112,8 +111,6 @@ haswilds
 hcalloc
 hgetc
 hgetline
-histentarr
-histentct
 hist_ring
 hist_skip_flags
 holdintr
@@ -196,7 +193,6 @@ promptexpand
 pushheap
 putshout
 pwd
-quietgetevent
 quietgethist
 quotedzputs
 readoutput