zsh-workers
 help / color / mirror / code / Atom feed
* seg fault with completion
@ 2001-07-20  9:25 Oliver Kiddle
  2001-07-20  9:41 ` Andrej Borsenkow
  2001-07-20 10:50 ` Sven Wischnowsky
  0 siblings, 2 replies; 4+ messages in thread
From: Oliver Kiddle @ 2001-07-20  9:25 UTC (permalink / raw)
  To: zsh-workers

This is in version 4.0.2 too so is not new.

s=( $a[(<tab> )
cursor positioned where I have put `<tab>'.

Oliver


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: seg fault with completion
  2001-07-20  9:25 seg fault with completion Oliver Kiddle
@ 2001-07-20  9:41 ` Andrej Borsenkow
  2001-07-20  9:46   ` Oliver Kiddle
  2001-07-20 10:50 ` Sven Wischnowsky
  1 sibling, 1 reply; 4+ messages in thread
From: Andrej Borsenkow @ 2001-07-20  9:41 UTC (permalink / raw)
  To: Oliver Kiddle, zsh-workers


>
> This is in version 4.0.2 too so is not new.
>
> s=( $a[(<tab> )
> cursor positioned where I have put `<tab>'.
>

Now it's my turn to say "works for me" :-) (but in CVS version)

bor@itsrm2% s=($a[(TAB
Completing subscript flags
I -- highest index of value matched by subscript
...

It is not exactly your example, but then I get very strange result:

bor@itsrm2% s=( $a[(TAB )
bor@itsrm2% s=( $a[( )!
Completing parameter
!            #            $            ?            ARGC         BAUD
COLUMNS      EGID         ERRNO        EUID         GID          HISTSIZE
KEYTIMEOUT   LINENO       LINES        LISTMAX      LOGCHECK     MAILCHECK
OPTIND       PPID         RANDOM       SECONDS      SHLVL        TTYIDLE
UID          status

Hmm ...

-andrej


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: seg fault with completion
  2001-07-20  9:41 ` Andrej Borsenkow
@ 2001-07-20  9:46   ` Oliver Kiddle
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Kiddle @ 2001-07-20  9:46 UTC (permalink / raw)
  To: zsh-workers

Andrej Borsenkow wrote:
> 
> Now it's my turn to say "works for me" :-) (but in CVS version)

Sorry, I forgot to mention this. Try again with setopt completeinword.
Should be repoducible - I've checked IRIX, Linux and Solaris and from
zsh -f.

Oliver


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: seg fault with completion
  2001-07-20  9:25 seg fault with completion Oliver Kiddle
  2001-07-20  9:41 ` Andrej Borsenkow
@ 2001-07-20 10:50 ` Sven Wischnowsky
  1 sibling, 0 replies; 4+ messages in thread
From: Sven Wischnowsky @ 2001-07-20 10:50 UTC (permalink / raw)
  To: zsh-workers

Oliver Kiddle wrote:

> This is in version 4.0.2 too so is not new.
> 
> s=( $a[(<tab> )
> cursor positioned where I have put `<tab>'.

Memory problem and hence not always reproducible.

It was using a pointer to compsuffix which might be freed by
ignore_suffix().

And that loop shouldn't be using `str' anyway, it's `more' there.

This'll go into 4.0.x, too.


Bye
  Sven

Index: Src/Zle/computil.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/computil.c,v
retrieving revision 1.65
diff -u -r1.65 computil.c
--- Src/Zle/computil.c	2001/07/19 08:40:37	1.65
+++ Src/Zle/computil.c	2001/07/20 10:48:53
@@ -2615,19 +2615,21 @@
                     ign = strlen(as);
             }
         }
+        more = dupstring(more);
+
         if (ign)
             ignore_suffix(ign);
 
         while (more && *more) {
-            if ((val = cv_next(d, &str, &arg))) {
+            if ((val = cv_next(d, &more, &arg))) {
                 zaddlinknode(state.vals, ztrdup(val->name));
                 if (arg) {
-                    if (str) {
-                        char sav = str[-1];
+                    if (more) {
+                        char sav = more[-1];
 
-                        str[-1] = '\0';
+                        more[-1] = '\0';
                         zaddlinknode(state.vals, ztrdup(arg));
-                        str[-1] = sav;
+                        more[-1] = sav;
                     } else {
                         zaddlinknode(state.vals, tricat(arg, compsuffix, ""));
                         nosfx = 1;

-- 
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-07-20 10:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-20  9:25 seg fault with completion Oliver Kiddle
2001-07-20  9:41 ` Andrej Borsenkow
2001-07-20  9:46   ` Oliver Kiddle
2001-07-20 10:50 ` Sven Wischnowsky

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).