zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Lots of test failures when --disable-multibyte
Date: Tue, 5 Apr 2022 09:00:27 -0700	[thread overview]
Message-ID: <CAH+w=7aEov8oDKF99U1DPzzO-4ksc9NurTMsofBpq1OwjncVwg@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7Y7t2Su6sXM6pu-CNUgh2qhwQG+fo3WaKPtmpnJAMn8rg@mail.gmail.com>

On Mon, Apr 4, 2022 at 3:00 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> Was testing: Zero-length string match in parameter substitution
>
> Plus the one immediately after it (Zero-length string match at end).
>
> I'm going to have to leave those one to someone else.

Actually this turned out to be pretty trivial, the git revision on the
test cases made it possible to find the previous patches to the
multibyte code and then copy to the corresponding spot.

diff --git a/Src/glob.c b/Src/glob.c
index ca28f20e8..400be12d5 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -3331,7 +3331,7 @@ igetmatch(char **sp, Patprog p, int fl, int n,
char *replstr,
         /* Largest possible match at tail of string:       *
          * move forward along string until we get a match. *
          * Again there's no optimisation.                  */
-        for (ioff = 0, t = s, umlen = uml; t < send;
+        for (ioff = 0, t = s, umlen = uml; t <= send;
          ioff++, t++, umlen--) {
         set_pat_start(p, t-s);
         if (pattrylen(p, t, send - t, umlen, &patstralloc, ioff)) {
@@ -3362,7 +3362,7 @@ igetmatch(char **sp, Patprog p, int fl, int n,
char *replstr,
         do {
         /* loop over all matches for global substitution */
         matched = 0;
-        for (; t < send; t++, ioff++, umlen--) {
+        for (; t <= send; t++, ioff++, umlen--) {
             /* Find the longest match from this position. */
             set_pat_start(p, t-s);
             if (pattrylen(p, t, send - t, umlen, &patstralloc, ioff)) {


  reply	other threads:[~2022-04-05 16:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04  2:03 Bart Schaefer
2022-04-04 14:43 ` Peter Stephenson
2022-04-04 15:31   ` Bart Schaefer
2022-04-04 16:23     ` Peter Stephenson
2022-04-04 21:10     ` Bart Schaefer
2022-04-04 21:45       ` Bart Schaefer
2022-04-04 22:00         ` Bart Schaefer
2022-04-05 16:00           ` Bart Schaefer [this message]
2022-04-05 16:15             ` Mikael Magnusson
2022-04-05 20:29           ` Peter Stephenson
2022-04-06  3:48             ` Bart Schaefer
2022-04-06  5:32             ` ZTST_continue (was Re: Lots of test failures when --disable-multibyte) Jun T
2022-04-06 13:37               ` Peter Stephenson
2022-04-07 12:33                 ` Jun T
2022-04-07 12:34                 ` Jun T
2022-04-04 18:52 ` Lots of test failures when --disable-multibyte 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='CAH+w=7aEov8oDKF99U1DPzzO-4ksc9NurTMsofBpq1OwjncVwg@mail.gmail.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).