* PATCH: auto-description
@ 2000-02-17 9:37 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-02-17 9:37 UTC (permalink / raw)
To: zsh-workers
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@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-02-17 9:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-17 9:37 PATCH: auto-description 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).