Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: auto-description
- X-seq: zsh-workers 9770
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: auto-description
- Date: Thu, 17 Feb 2000 10:37:42 +0100 (MET)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
This didn't test for strings containing only white space, sometimes
giving completely useless (empty) `descriptions'.
Bye
Sven
diff -ru ../z.old/Src/Zle/computil.c Src/Zle/computil.c
--- ../z.old/Src/Zle/computil.c Thu Feb 17 10:22:54 2000
+++ Src/Zle/computil.c Thu Feb 17 10:32:56 2000
@@ -760,10 +760,18 @@
opt->name = ztrdup(rembslashcolon(name));
if (descr)
opt->descr = ztrdup(descr);
- else if (adpre && oargs && !oargs->next &&
- oargs->descr && oargs->descr[0])
- opt->descr = tricat(adpre, oargs->descr, adsuf);
- else
+ else if (adpre && oargs && !oargs->next) {
+ char *d;
+
+ for (d = oargs->descr; *d; d++)
+ if (!iblank(*d))
+ break;
+
+ if (*d)
+ opt->descr = tricat(adpre, oargs->descr, adsuf);
+ else
+ opt->descr = NULL;
+ } else
opt->descr = NULL;
opt->xor = xor;
opt->type = otype;
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author