diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-01 14:48:28 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-08-01 14:48:28 +0000 |
commit | 61e68d70da5af5afe943f92cd94a8c96e78348d9 (patch) | |
tree | 1e88adbfc21452caedcb57af2880097a349f44e6 /Src/Zle | |
parent | 14810d6df13e0564a606b74e4c4e918e80862e25 (diff) | |
download | zsh-61e68d70da5af5afe943f92cd94a8c96e78348d9.tar.gz zsh-61e68d70da5af5afe943f92cd94a8c96e78348d9.tar.xz zsh-61e68d70da5af5afe943f92cd94a8c96e78348d9.zip |
zsh-3.1.6 dot-zsh-199908011751
Diffstat (limited to 'Src/Zle')
-rw-r--r-- | Src/Zle/comp1.export | 3 | ||||
-rw-r--r-- | Src/Zle/zle.export | 2 | ||||
-rw-r--r-- | Src/Zle/zle_tricky.c | 17 |
3 files changed, 14 insertions, 8 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++; |