zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: Strange behavior of [[
Date: Tue, 9 Jun 2015 22:31:56 -0700	[thread overview]
Message-ID: <150609223156.ZM29890@torch.brasslantern.com> (raw)
In-Reply-To: <5577AE8F.6060902@arthaud.me>

On Jun 9,  8:27pm, Maxime Arthaud wrote:
} Subject: Strange behavior of [[
}
} Hi everybody!
} 
} I just found a very strange behavior in zsh (v5.0.8).
} 
} % [[ " X" =~ "X" ]]
} where in " X" the first character is a non-breaking space (0xa0).
} My shell gets stuck, and Ctrl-C is not working. With bash, no problem.
} 
} Does anyone have an explanation? I think it's a bug.

MB_METACHARLEN() is returning that 0xa0 is a zero-width character, so
"ptr" in the "while (ptr < lhstr + m->rm_so)" loop in regex.c never
advances.  That macro ultimately resolves to mb_metacharlenconv_r()
from utils.c, which returns zero here:

4861		return 0;		/* Probably shouldn't happen */


This means that imeta() is (incorrectly?) returning true for 0xa0, which
might mean that we're passing an unmetafied string where a metafied
string is expected.


  reply	other threads:[~2015-06-10  5:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-10  3:27 Maxime Arthaud
2015-06-10  5:31 ` Bart Schaefer [this message]
2015-06-10  8:55   ` Peter Stephenson
2015-06-11 16:59     ` Peter Stephenson
2015-06-22 15:56       ` m0viefreak
2015-06-22 16:29         ` Peter Stephenson
2016-01-08 13:09 ` Jun T.
2016-04-23  9:51   ` Segfault with PCRE (Re: Strange behavior of [[) Mikael Berthe
2016-04-23 21:22     ` Bart Schaefer

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=150609223156.ZM29890@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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).