summary refs log tree commit diff
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-13 10:49:18 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2000-06-13 10:49:18 +0000
commita2417f68636e69c4ba5c9ae441277b84619314b6 (patch)
tree3b965ed34fcbdfd668bb823000bd3ad08841ff81
parent65b3fdc4ab7db92bdb046fa1d69ac2ae7c3b03b9 (diff)
downloadzsh-a2417f68636e69c4ba5c9ae441277b84619314b6.tar.gz
zsh-a2417f68636e69c4ba5c9ae441277b84619314b6.tar.xz
zsh-a2417f68636e69c4ba5c9ae441277b84619314b6.zip
fix for longer capability strings (sunsite still not responding, sigh)
-rw-r--r--ChangeLog7
-rw-r--r--Src/Zle/complist.c14
2 files changed, 14 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 968312783..42c3cc23c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,15 @@
+2000-06-13  Sven Wischnowsky  <wischnow@zsh.org>
+
+	* ?????: Src/Zle/complist.c: fix for longer capability strings;
+	very bad
+
 2000-06-13  Peter Stephenson  <pws@cambridgesiliconradio.com>
 
 	* TBA: Src/zsh.h: make PRINT_ flags unique again.
 
 2000-06-13  Sven Wischnowsky  <wischnow@zsh.org>
 
-	* ?????: Completion/Core/_path_files, Src/Zle/complete.c,
+	* 11870: Completion/Core/_path_files, Src/Zle/complete.c,
  	Src/Zle/compmatch.c, Src/Zle/computil.c: fixes for calling
 	compfiles, for completing words with special characters; make
 	compfiles optimisations work with globcomplete and simple match
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index a5cabe878..81c6c76a8 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -122,13 +122,17 @@ struct listcols {
     Extcol exts;		/* strings for extensions */
 };
 
+/* Combined length of LC and RC, maximum length of capability strings. */
+
+static int lr_caplen, max_caplen;
+
 /* This parses the value of a definition (the part after the `=').
  * The return value is a pointer to the character after it. */
 
 static char *
 getcolval(char *s, int multi)
 {
-    char *p;
+    char *p, *o = s;
 
     for (p = s; *s && *s != ':' && (!multi || *s != '='); p++, s++) {
 	if (*s == '\\' && s[1]) {
@@ -172,6 +176,8 @@ getcolval(char *s, int multi)
     }
     if (p != s)
 	*p = '\0';
+    if ((s - o) > max_caplen)
+	max_caplen = s - o;
     return s;
 }
 
@@ -325,10 +331,6 @@ filecol(char *col)
     return fc;
 }
 
-/* Combined length of LC and RC, maximum length of capability strings. */
-
-static int lr_caplen, max_caplen;
-
 /* This initializes the given terminal color structure. */
 
 static void
@@ -337,6 +339,7 @@ getcols(Listcols c)
     char *s;
     int i, l;
 
+    max_caplen = lr_caplen = 0;
     if (!(s = getsparam("ZLS_COLORS")) &&
 	!(s = getsparam("ZLS_COLOURS"))) {
 	for (i = 0; i < NUM_COLS; i++)
@@ -362,7 +365,6 @@ getcols(Listcols c)
 	s = getcoldef(c, s);
 
     /* Use default values for those that aren't set explicitly. */
-    max_caplen = lr_caplen = 0;
     for (i = 0; i < NUM_COLS; i++) {
 	if (!c->files[i] || !c->files[i]->col)
 	    c->files[i] = filecol(defcols[i]);