From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@sunsite.auc.dk
Subject: Re: The pattern containing NUL.
Date: Mon, 19 Jul 1999 10:09:42 +0200 [thread overview]
Message-ID: <9907190809.AA35966@ibmth.df.unipi.it> (raw)
In-Reply-To: "Tanaka Akira"'s message of "19 Jul 1999 13:38:43 DFT." <rsq7lnxuucs.fsf@crane.jaist.ac.jp>
Tanaka Akira wrote:
> zsh-3.1.6-test-1 dumps core as following on NetBSD 1.4.
>
> Z(2):akr@localhost% Src/zsh -f
> localhost% print $OSTYPE
> netbsd1.4
> localhost% print $ZSH_VERSION
> 3.1.6-test-1
> localhost% tmp=a
> localhost% print "${line#$'\0'}"
> zsh: segmentation fault (core dumped) Src/zsh -f
> Z(2):akr@localhost%
>
> The backtrace was follows.
Well, I can't get the core dump and don't entirely believe the backtrace,
but there does seem to be a bug... does this fix it?
We really need a pattern matching expert to fix up the globbing code. It's
slow and complicated (all right, it would look out of place if wasn't).
--- Src/glob.c.null Sun Jul 18 17:37:35 1999
+++ Src/glob.c Mon Jul 19 10:03:42 1999
@@ -2724,6 +2724,9 @@
* Here we bypass tulower() and tuupper() for speed.
*/
int xi = (STOUC(UNMETA(x)) & 0xff), yi = (STOUC(UNMETA(y)) & 0xff);
+ /* A NULL is a real null, since a \000 would be metafied. */
+ if (!*x || !*y)
+ return 0;
return xi == yi ||
(((c->stat & C_IGNCASE) ?
((isupper(xi) ? tolower(xi) : xi) ==
--
Peter Stephenson <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
next prev parent reply other threads:[~1999-07-19 8:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-07-19 4:38 Tanaka Akira
1999-07-19 8:09 ` Peter Stephenson [this message]
1999-07-19 14:05 ` Tanaka Akira
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9907190809.AA35966@ibmth.df.unipi.it \
--to=pws@ibmth.df.unipi.it \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).