From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6084 invoked by alias); 23 Jul 2016 18:04:33 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 38925 Received: (qmail 25136 invoked from network); 23 Jul 2016 18:04:33 -0000 X-Qmail-Scanner-Diagnostics: from hermes.apache.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(140.211.11.3):SA:0(-1.3/5.0):. Processed in 0.09945 secs); 23 Jul 2016 18:04:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RP_MATCHES_RCVD autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: danielsh@apache.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at apache.org does not designate permitted sender hosts) Date: Sat, 23 Jul 2016 18:04:30 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: [PATCH] _describe and literal \n Message-ID: <20160723180430.GA22451@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Current behaviour: [[[ $ zsh -f % autoload compinit % compinit % _f() { a=( $'foo:hello\nworld' $'bar:lorem\nipsum' ); _describe descr a } % compdef _f f % f bar -- lorem ipsum foo -- hello world ]]] Proposed patch: [[[ diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index e8f0a6f..9e3ea3c 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -531,7 +531,7 @@ cd_init(char *nam, char *hide, char *mlen, char *sep, tmp++; if (*tmp) - str->desc = ztrdup(rembslash(tmp + 1)); + str->desc = nicedup(rembslash(tmp + 1), 0 /* heap? */); else str->desc = NULL; *tmp = '\0'; ]]] Gives: [[[ % f bar -- lorem\nipsum foo -- hello\nworld ]]] Is this fix correct?