zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _cvs should complete dot-files (?)
@ 1999-07-28  5:12 Bart Schaefer
  1999-07-28 13:34 ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 1999-07-28  5:12 UTC (permalink / raw)
  To: zsh-workers

After 7295 and 7296, the _cvs completer stopped matching files whose name
begins with a dot upon "cvs add".  This restores that behavior, and also
removes the now-extraneous assignment to $all.

I personally want dot-files completed here, but it might be nice to omit
them unless you've typed the leading dot yourself.  That behavior is at
the end as a uuencoded patch (so you can't accidentally apply both; they
conflict).

Index: Completion/User/_cvs
===================================================================
@@ -308,13 +308,12 @@
   if [[ -d ${pref}CVS ]]; then
     _cvsentries
     setopt localoptions unset
-    local all omit
-    all=( ${pref}*~${pref}CVS(D:t) )
+    local omit
     omit=( CVS $entries ${=cvsignore} )
     [[ -r ~/.cvsignore ]] && omit=( $omit $(<~/.cvsignore) )
     [[ -r ${pref}.cvsignore ]] && omit=( $omit $(<${pref}.cvsignore) )
-    compgen -g '*~(*/|)('${(j:|:)omit:q}')' ||
-    { _cvsdirentries; compgen -g '('${(j:|:)entries:q}')' }
+    compgen -g '*~(*/|)('${(j:|:)omit:q}')(D)' ||
+    { _cvsdirentries; compgen -g '('${(j:|:)entries:q}')(D)' }
   else
     _files
   fi


The first line of this uuencoded block is a compgen command cut'n'pasted
from xtrace output of the _cvsaddp function that results after applying
the patch in the rest of the block and then typing "cvs add Src/<TAB>" in
my zsh source tree.  3.1.6-test-3 dumps core with a garbaged stack (no
useful backtrace) while trying to execute that compgen.

begin 664 alternate._cvs.diff
M8V]M<&=E;B`M9R`H+EPC36%K969I;&4N:6XN,2XU?"Y<(TUA:V5F:6QE+FEN
M+C$N-GPN7"--86ME9FEL92YI;BXQ+C=\+EPC36%K96UO9"YI;BYI;BXQ+C-\
M+EPC8G5I;'1I;BYC+C$N,C9\+EPC8G5I;'1I;BYC+C$N,C=\+EPC8G5I;'1I
M;BYC+C$N,S)\+E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F5F?4-64RA$.G0I
M("D**R`@("!A;&P]*"`D>W!R969]*BA$.G0I("D*("`@("!O;6ET/2@@0U93
M("1E;G1R:65S("1[/6-V<VEG;F]R97T@*0H@("`@(%M;("UR('XO+F-V<VEG
M;F]R92!=72`F)B!O;6ET/2@@)&]M:70@)"@\?B\N8W9S:6=N;W)E*2`I"B`@
M("`@6UL@+7(@)'MP<F5F?2YC=G-I9VYO<F4@75T@)B8@;VUI=#TH("1O;6ET
M("0H/"1[<')E9GTN8W9S:6=N;W)E*2`I"BT@("`@8V]M<&=E;B`M9R`G*GXH
M*B]\*2@G)'LH:CI\.BEO;6ET.G%])RDG('Q\"BT@("`@>R!?8W9S9&ER96YT
M<FEE<SL@8V]M<&=E;B`M9R`G*"<D>RAJ.GPZ*65N=')I97,Z<7TG*2<@?0HK
M("`@(&-O;7!G96X@+6<@)R@G)'LH:CI\.BEA;&PZ<7TG*7XH*B]\*2@G)'LH
M:CI\.BEO;6ET.G%])RDG('Q\"BL@("`@>R!?8W9S9&ER96YT<FEE<SL@8V]M
M<&=E;B`M9R`G*"<D>RAJ.GPZ*65N=')I97,Z<7TG*2A$*2<@?0H@("!E;'-E
3"B`@("`@7V9I;&5S"B`@(&9I"@``
`
end

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

* Re: PATCH: _cvs should complete dot-files (?)
  1999-07-28  5:12 PATCH: _cvs should complete dot-files (?) Bart Schaefer
@ 1999-07-28 13:34 ` Peter Stephenson
  1999-07-28 15:49   ` Tanaka Akira
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 1999-07-28 13:34 UTC (permalink / raw)
  To: zsh-workers

"Bart Schaefer" wrote:
> The first line of this uuencoded block is a compgen command cut'n'pasted
> from xtrace output of the _cvsaddp function that results after applying
> the patch in the rest of the block and then typing "cvs add Src/<TAB>" in
> my zsh source tree.  3.1.6-test-3 dumps core with a garbaged stack (no
> useful backtrace) while trying to execute that compgen.

I can't get this any simple way, nor does the pattern itself seem to be the
problem.  Is there an easy way of showing it (e.g. with a fixed argument to
compgen?)

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

* Re: PATCH: _cvs should complete dot-files (?)
  1999-07-28 13:34 ` Peter Stephenson
@ 1999-07-28 15:49   ` Tanaka Akira
  1999-07-28 16:05     ` PATCH: 3.1.6-test-3: crash in _cvs dot-files stuff Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Tanaka Akira @ 1999-07-28 15:49 UTC (permalink / raw)
  To: zsh-workers

In article <9907281334.AA33903@ibmth.df.unipi.it>,
  Peter Stephenson <pws@ibmth.df.unipi.it> writes:

> I can't get this any simple way, nor does the pattern itself seem to be the
> problem.  Is there an easy way of showing it (e.g. with a fixed argument to
> compgen?)

It is reproduced under my Solaris 7 environment.

Z(2):akr@is27e1u11% bin/zsh -f
is27e1u11% autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% _tst () { compgen -g '(.\#Makefile.in.1.5|<this-part-is-too-long-so-omitted>|.\#params.c.1.46)' }
is27e1u11% tst <TAB>zsh: segmentation fault (core dumped)  bin/zsh -f
Z(2):akr@is27e1u11% 

Z(2):akr@is27e1u11% gdb bin/zsh core
GNU gdb 19981224
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.7"...
Core was generated by `bin/zsh -f'.
Program terminated with signal 11, Segmentation Fault.
Reading symbols from /usr/lib/libsocket.so.1...done.
Reading symbols from /usr/lib/libdl.so.1...done.
Reading symbols from /usr/lib/libnsl.so.1...done.
Reading symbols from /usr/lib/libcurses.so.1...done.
Reading symbols from /usr/lib/libc.so.1...done.
Reading symbols from /usr/lib/libmp.so.2...done.
Reading symbols from /usr/platform/SUNW,Ultra-5_10/lib/libc_psr.so.1...done.
Reading symbols from /usr/lib/locale/ja/ja.so.2...done.
Reading symbols from /usr/lib/locale/ja/methods_ja.so.2...done.
Reading symbols from /home/fs114/akr/zsh/zsh-debug/lib/zsh/3.1.6-test-3/comp1.so...done.
Reading symbols from /home/fs114/akr/zsh/zsh-debug/lib/zsh/3.1.6-test-3/zle.so...done.
Reading symbols from /home/fs114/akr/zsh/zsh-debug/lib/zsh/3.1.6-test-3/compctl.so...done.
#0  0xff0b051c in makecomplistflags (cc=0x1278b0, s=0xce410 "", incmd=0, 
    compadd=0) at zle_tricky.c:6380
6380                                    pa[o] = '\0';
(gdb) where
#0  0xff0b051c in makecomplistflags (cc=0x1278b0, s=0xce410 "", incmd=0, 
    compadd=0) at zle_tricky.c:6380
#1  0xff0acc70 in makecomplistlist (cc=0x1278b0, s=0xce3e8 "", incmd=0, 
    compadd=0) at zle_tricky.c:5650
#2  0xff0acad4 in makecomplistor (cc=0x1278b0, s=0xce3e8 "", incmd=0, 
    compadd=0, sub=0) at zle_tricky.c:5616
#3  0xff0abac0 in makecomplistcall (cc=0x1278b0) at zle_tricky.c:5335
#4  0xff049650 in bin_compgen (name=0xfbb58 "compgen", argv=0xfbff8, 
    ops=0xffbeb628 "", func=0) at compctl.c:1709
#5  0x1b7dc in execbuiltin (args=0xfbb50, bn=0xff05d660) at builtin.c:366
#6  0x344f4 in execcmd (cmd=0xe3cb0, input=0, output=0, how=2, last1=2)
    at exec.c:2024
#7  0x300e0 in execpline2 (pline=0x112458, how=2, input=0, output=0, last1=0)
    at exec.c:1054
#8  0x2f240 in execpline (l=0x110a90, how=2, last1=0) at exec.c:869
#9  0x2eb68 in execlist (list=0x112398, dont_change_job=1, exiting=0)
    at exec.c:738
#10 0x38048 in runshfunc (list=0x112398, wrap=0x0, name=0x120648 "_tst")
    at exec.c:3019
#11 0xff04bbf0 in comp_wrapper (list=0x112398, w=0x0, name=0x120648 "_tst")
    at compctl.c:2415
#12 0x37f78 in runshfunc (list=0x112398, wrap=0xff05d770, name=0x120648 "_tst")
    at exec.c:3006
#13 0x37c70 in doshfunc (name=0x120648 "_tst", list=0x112398, 
    doshargs=0xfbaa8, flags=0, noreturnval=0) at exec.c:2957
#14 0x37654 in execshfunc (cmd=0xe0ca0, shf=0x112308, args=0xfbaa8)
    at exec.c:2850
#15 0x343f4 in execcmd (cmd=0xe0ca0, input=0, output=0, how=2, last1=2)
    at exec.c:2013
#16 0x300e0 in execpline2 (pline=0x10db98, how=2, input=0, output=0, last1=0)
    at exec.c:1054
#17 0x2f240 in execpline (l=0x110630, how=2, last1=0) at exec.c:869
#18 0x2eb8c in execlist (list=0x10d688, dont_change_job=1, exiting=0)
    at exec.c:744
#19 0x3797c in execautofn (cmd=0x11f058, args=0x0, flags=0) at exec.c:2897
#20 0x34164 in execcmd (cmd=0x11f058, input=0, output=0, how=2, last1=2)
    at exec.c:1976
#21 0x300e0 in execpline2 (pline=0x125ea8, how=2, input=0, output=0, last1=0)
    at exec.c:1054
#22 0x2f240 in execpline (l=0x125108, how=2, last1=0) at exec.c:869
#23 0x2eb68 in execlist (list=0x125ec0, dont_change_job=1, exiting=0)
    at exec.c:738
#24 0x38048 in runshfunc (list=0x125ec0, wrap=0x0, name=0x123820 "_normal")
    at exec.c:3019
#25 0xff04bbf0 in comp_wrapper (list=0x125ec0, w=0x0, name=0x123820 "_normal")
    at compctl.c:2415
#26 0x37f78 in runshfunc (list=0x125ec0, wrap=0xff05d770, 
    name=0x123820 "_normal") at exec.c:3006
#27 0x37c70 in doshfunc (name=0x123820 "_normal", list=0x125ec0, 
    doshargs=0xf1c28, flags=2176, noreturnval=0) at exec.c:2957
#28 0x37654 in execshfunc (cmd=0xe3670, shf=0x125de8, args=0xf1c28)
    at exec.c:2850
#29 0x343f4 in execcmd (cmd=0xe3670, input=0, output=0, how=2, last1=2)
    at exec.c:2013
#30 0x300e0 in execpline2 (pline=0x111400, how=2, input=0, output=0, last1=0)
    at exec.c:1054
#31 0x2f240 in execpline (l=0x10c538, how=2, last1=0) at exec.c:869
#32 0x2eb68 in execlist (list=0x10d718, dont_change_job=1, exiting=0)
    at exec.c:738
#33 0x639b8 in execif (cmd=0xe36c0, args=0x0, flags=0) at loop.c:404
---Type <return> to continue, or q <return> to quit---
#34 0x34164 in execcmd (cmd=0xe36c0, input=0, output=0, how=2, last1=2)
    at exec.c:1976
#35 0x300e0 in execpline2 (pline=0x10f898, how=2, input=0, output=0, last1=0)
    at exec.c:1054
#36 0x2f240 in execpline (l=0x110830, how=2, last1=0) at exec.c:869
#37 0x2eb68 in execlist (list=0x10f428, dont_change_job=1, exiting=0)
    at exec.c:738
#38 0x3797c in execautofn (cmd=0x115c18, args=0x0, flags=0) at exec.c:2897
#39 0x34164 in execcmd (cmd=0x115c18, input=0, output=0, how=2, last1=2)
    at exec.c:1976
#40 0x300e0 in execpline2 (pline=0x11de00, how=2, input=0, output=0, last1=0)
    at exec.c:1054
#41 0x2f240 in execpline (l=0x118978, how=2, last1=0) at exec.c:869
#42 0x2eb68 in execlist (list=0x11de18, dont_change_job=1, exiting=0)
    at exec.c:738
#43 0x38048 in runshfunc (list=0x11de18, wrap=0x0, name=0x11de30 "_complete")
    at exec.c:3019
#44 0xff04bbf0 in comp_wrapper (list=0x11de18, w=0x0, 
    name=0x11de30 "_complete") at compctl.c:2415
#45 0x37f78 in runshfunc (list=0x11de18, wrap=0xff05d770, 
    name=0x11de30 "_complete") at exec.c:3006
#46 0x37c70 in doshfunc (name=0x11de30 "_complete", list=0x11de18, 
    doshargs=0xeae90, flags=2176, noreturnval=0) at exec.c:2957
#47 0x37654 in execshfunc (cmd=0xe3b98, shf=0x11dc08, args=0xeae90)
    at exec.c:2850
#48 0x343f4 in execcmd (cmd=0xe3b98, input=0, output=0, how=2, last1=2)
    at exec.c:2013
#49 0x300e0 in execpline2 (pline=0x112218, how=2, input=0, output=0, last1=0)
    at exec.c:1054
#50 0x2f240 in execpline (l=0x110a10, how=2, last1=0) at exec.c:869
#51 0x2eb68 in execlist (list=0x1121e8, dont_change_job=1, exiting=0)
    at exec.c:738
#52 0x63838 in execif (cmd=0xe3bc0, args=0x0, flags=0) at loop.c:392
#53 0x34164 in execcmd (cmd=0xe3bc0, input=0, output=0, how=2, last1=2)
    at exec.c:1976
#54 0x300e0 in execpline2 (pline=0x10f260, how=2, input=0, output=0, last1=0)
    at exec.c:1054
#55 0x2f240 in execpline (l=0x10c438, how=2, last1=0) at exec.c:869
#56 0x2eb68 in execlist (list=0x112170, dont_change_job=1, exiting=0)
    at exec.c:738
#57 0x62410 in execfor (cmd=0xe3be8, args=0xeae50, flags=0) at loop.c:117
#58 0x34164 in execcmd (cmd=0xe3be8, input=0, output=0, how=2, last1=2)
    at exec.c:1976
#59 0x300e0 in execpline2 (pline=0x10ff90, how=2, input=0, output=0, last1=0)
    at exec.c:1054
#60 0x2f240 in execpline (l=0x10df00, how=2, last1=0) at exec.c:869
#61 0x2eb68 in execlist (list=0x10f320, dont_change_job=1, exiting=0)
    at exec.c:738
#62 0x3797c in execautofn (cmd=0x11eef0, args=0x0, flags=0) at exec.c:2897
#63 0x34164 in execcmd (cmd=0x11eef0, input=0, output=0, how=2, last1=2)
    at exec.c:1976
#64 0x300e0 in execpline2 (pline=0x125bd8, how=2, input=0, output=0, last1=0)
    at exec.c:1054
#65 0x2f240 in execpline (l=0x124f28, how=2, last1=0) at exec.c:869
#66 0x2eb68 in execlist (list=0x125bf0, dont_change_job=1, exiting=0)
    at exec.c:738
#67 0x38048 in runshfunc (list=0x125bf0, wrap=0x0, 
    name=0x117f08 "_main_complete") at exec.c:3019
#68 0xff04bbf0 in comp_wrapper (list=0x125bf0, w=0x0, 
    name=0x117f08 "_main_complete") at compctl.c:2415
---Type <return> to continue, or q <return> to quit---
#69 0x37f78 in runshfunc (list=0x125bf0, wrap=0xff05d770, 
    name=0x117f08 "_main_complete") at exec.c:3006
#70 0x37c70 in doshfunc (name=0x117f08 "_main_complete", list=0x125bf0, 
    doshargs=0x0, flags=0, noreturnval=0) at exec.c:2957
#71 0xff0a95cc in callcompfunc (s=0xce3c0 "", fn=0x117f08 "_main_complete")
    at zle_tricky.c:4781
#72 0xff0a9fa0 in makecomplist (s=0xce3c0 "", incmd=0, lst=0)
    at zle_tricky.c:4938
#73 0xff0a7e24 in docompletion (s=0x1205e8 "", lst=0, incmd=0)
    at zle_tricky.c:4452
#74 0xff09a764 in docomplete (lst=0) at zle_tricky.c:1078
#75 0xff097be8 in expandorcomplete (args=0xff0d80e8) at zle_tricky.c:491
#76 0xff097678 in completecall (args=0xff0d80e8) at zle_tricky.c:390
#77 0xff088974 in execzlefunc (func=0xff0d6044, args=0xff0d80e8)
    at zle_main.c:628
#78 0xff088468 in zleread (lp=0xc9468 "%m%# ", rp=0x0, flags=3)
    at zle_main.c:547
#79 0x54c94 in inputline () at input.c:265
#80 0x54a60 in ingetc () at input.c:210
#81 0x4a980 in ihgetc () at hist.c:242
#82 0x5cb2c in gettok () at lex.c:545
#83 0x5be90 in yylex () at lex.c:308
#84 0x79d24 in parse_event () at parse.c:105
#85 0x514cc in loop (toplevel=1, justonce=0) at init.c:113
#86 0x1a8b8 in main (argc=2, argv=0xffbef494) at ./main.c:89
(gdb) print pa
$1 = "\210.#Makefile.in.1.5\214.#Makefile.in.1.6\214.#Makefile.in.1.7\214.#Makemod.in.in.1.3\214.#builtin.c.1.26\214.#builtin.c.1.27\214.#builtin.c.1.32\214.#builtin.c.1.36\214.#builtin.c.1.41\214.#builtin.c.1.43\214.#cond.c.1.7\214.#cond.c.1"...
(gdb) print o
$2 = 914948096
(gdb) 
-- 
Tanaka Akira


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

* PATCH: 3.1.6-test-3: crash in _cvs dot-files stuff
  1999-07-28 15:49   ` Tanaka Akira
@ 1999-07-28 16:05     ` Peter Stephenson
  1999-07-28 16:13       ` Peter Stephenson
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Stephenson @ 1999-07-28 16:05 UTC (permalink / raw)
  To: zsh-workers

Tanaka Akira wrote:
> In article <9907281334.AA33903@ibmth.df.unipi.it>,
>   Peter Stephenson <pws@ibmth.df.unipi.it> writes:
> 
> > I can't get this any simple way, nor does the pattern itself seem to be the
> > problem.  Is there an easy way of showing it (e.g. with a fixed argument to
> > compgen?)
> 
> It is reproduced under my Solaris 7 environment.
>
> #0  0xff0b051c in makecomplistflags (cc=0x1278b0, s=0xce410 "", incmd=0, 
>     compadd=0) at zle_tricky.c:6380
> 6380                                    pa[o] = '\0';

This gives the game away.  The pattern was arbitrarily limited to PATH_MAX
--- but unlike the resulting file, there's no reason why it should be, nor
was it tested.  The following makes the buffer dynamically reallocated.  At
this time pre-release it's good to be sensitive to memory leaks, but I
don't see one.  Please don't take my word for it.

--- Src/Zle/zle_tricky.c.pm	Tue Jul 27 17:07:08 1999
+++ Src/Zle/zle_tricky.c	Wed Jul 28 17:49:06 1999
@@ -6283,8 +6283,8 @@
 			    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];
 
@@ -6298,8 +6298,9 @@
 			    }
 			    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 *
@@ -6338,6 +6339,10 @@
 				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));
 				}
@@ -6383,6 +6388,8 @@
 			    glob_pre = glob_suf = NULL;
 			    noerrs = ne;
 			    opts[MARKDIRS] = md;
+
+			    zfree(pa, paalloc);
 			}
 		    }
 		    dirs++;

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

* Re: PATCH: 3.1.6-test-3: crash in _cvs dot-files stuff
  1999-07-28 16:05     ` PATCH: 3.1.6-test-3: crash in _cvs dot-files stuff Peter Stephenson
@ 1999-07-28 16:13       ` Peter Stephenson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 1999-07-28 16:13 UTC (permalink / raw)
  To: zsh-workers

dammit.

--- Src/Zle/zle_tricky.c.pm2	Wed Jul 28 17:49:06 1999
+++ Src/Zle/zle_tricky.c	Wed Jul 28 18:07:17 1999
@@ -6340,7 +6340,7 @@
 				/* 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)
+				    if (minlen >= paalloc)
 					pa = (char *)
 					    zrealloc(pa, paalloc = minlen+1);
 				    strcpy(pa + o, g);

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

end of thread, other threads:[~1999-07-28 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-28  5:12 PATCH: _cvs should complete dot-files (?) Bart Schaefer
1999-07-28 13:34 ` Peter Stephenson
1999-07-28 15:49   ` Tanaka Akira
1999-07-28 16:05     ` PATCH: 3.1.6-test-3: crash in _cvs dot-files stuff Peter Stephenson
1999-07-28 16:13       ` Peter Stephenson

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