Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Completion/matching control problem



Here's a problem with matching control that I encountered.  I've been
meaning to send this patch in for some time.  If I understood the code
better, I think I provide a cleaner test case.  

	mkdir bug
	cd bug
	touch Abc-Def-Ghij.txt
	touch Abc-def.ghi.jkl_mno.pqr.txt
	touch Abc_def_ghi_jkl_mno_pqr.txt
	compctl -M 'm:{a-z}={A-Z} r:|[.,_-]=*'
	ls a-a<TAB>

I sometimes see either a hang or a core dump.

The problem seems to occur when match_str is called with test=1 and abort_match
is called, the globals matchparts&matchsubs end up pointing to free'd clines,
which causes problems for code that attempts to append clines to the list.

I another problem is if you type:
	ls a<TAB>
you get:
	ls Abcdefghi
which doesn't seem correct, but I figure someone who understands the code might
be able to fix this one.

--- os/Zle/zle_tricky.c		Sun Jul 25 18:38:50 1999
+++ Src/Zle/zle_tricky.c	Mon Jul 26 22:44:26 1999
@@ -2121,6 +2121,7 @@
 {
     free_cline(matchparts);
     free_cline(matchsubs);
+    matchparts = matchsubs = NULL;
 }
 
 /* This adds a new string in the static char buffer. The arguments are


_____________________________________________________________
Do You Yahoo!?
Free instant messaging and more at http://messenger.yahoo.com



Messages sorted by: Reverse Date, Date, Thread, Author