From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: compctl -l with non-empty argument.
Date: Wed, 16 Jun 1999 08:37:24 +0200 (MET DST) [thread overview]
Message-ID: <199906160637.IAA05062@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: Tanaka Akira's message of 16 Jun 1999 01:45:40 +0900
Tanaka Akira wrote:
> After above operation, compctl -L print follows.
>
> is27e1u11% compctl -L
> compctl -k '(a b c)' aaa
> compctl -l bbb bbb
> compctl -C -c -tn
> compctl -D -f -tn
> compctl -T
>
> Hmm. Argument for -l is replaced...
Hm, I can't reproduce this. Could you try the patch below and tell us
if it works?
Bye
Sven
diff -u os/Zle/zle_tricky.c Src/Zle/zle_tricky.c
--- os/Zle/zle_tricky.c Wed Jun 16 08:22:35 1999
+++ Src/Zle/zle_tricky.c Wed Jun 16 08:31:46 1999
@@ -6507,7 +6507,7 @@
if (cc->subcmd) {
/* Handle -l sub-completion. */
char **ow = clwords, *os = cmdstr, *ops = NULL;
- int oldn = clwnum, oldp = clwpos;
+ int oldn = clwnum, oldp = clwpos, br;
unsigned long occ = ccont;
ccont = CC_CCCONT;
@@ -6523,21 +6523,22 @@
erange = 1;
clwnum = erange - brange + 1;
clwpos = clwpos - brange;
-
+ br = brange;
+
if (cc->subcmd[0]) {
/* And probably put the command name given to the flag *
* in the array. */
clwpos++;
clwnum++;
incmd = 0;
- ops = clwords[brange - 1];
- clwords[brange - 1] = cc->subcmd;
+ ops = clwords[br - 1];
+ clwords[br - 1] = ztrdup(cc->subcmd);
cmdstr = ztrdup(cc->subcmd);
- clwords += brange - 1;
+ clwords += br - 1;
} else {
- cmdstr = ztrdup(clwords[brange]);
+ cmdstr = ztrdup(clwords[br]);
incmd = !clwpos;
- clwords += brange;
+ clwords += br;
}
/* Produce the matches. */
makecomplistcmd(s, incmd, CFN_FIRST);
@@ -6548,8 +6549,10 @@
cmdstr = os;
clwnum = oldn;
clwpos = oldp;
- if (ops)
- clwords[brange - 1] = ops;
+ if (ops) {
+ zsfree(clwords[br - 1]);
+ clwords[br - 1] = ops;
+ }
ccont = occ;
}
if (cc->substr)
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
next reply other threads:[~1999-06-16 6:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-16 6:37 Sven Wischnowsky [this message]
1999-06-16 6:44 ` Tanaka Akira
-- strict thread matches above, loose matches on Subject: below --
1999-06-15 16:45 Tanaka Akira
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199906160637.IAA05062@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).