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: Mon, 4 Apr 2022 11:52:17 -0700	[thread overview]
Message-ID: <CAH+w=7YFW2UEchbS4BUmLaoFj4WomrJqG3eEhXsJz9KwYMuihA@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7Y5-0DFcJUL2c9uvtC3Q4cKFiMaXKTewFzt6yvTEYKSvQ@mail.gmail.com>

On Sun, Apr 3, 2022 at 7:03 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> ./D01prompt.ztst: starting.
> --- /tmp/zsh.ztst.159862/ztst.out    2022-04-03 18:48:45.714786786 -0700
> +++ /tmp/zsh.ztst.159862/ztst.tout    2022-04-03 18:48:45.718786838 -0700
> @@ -1 +1 @@
> -
> +V
> Test ./D01prompt.ztst failed: output differs from expected as shown above for:
>   print ${(%U)Y-%(v}
> Was testing: Regression test for test on empty psvar
> ./D01prompt.ztst: test failed.

Here's a patch for that one, bringing it in line with the multibyte branch.

diff --git a/Src/hist.c b/Src/hist.c
index d4557d424..f9440dba7 100644
--- a/Src/hist.c
+++ b/Src/hist.c
@@ -2252,6 +2252,7 @@ casemodify(char *str, int how)
 #endif
     while (*str) {
         int c;
+        int mod = 0;
         if (*str == Meta) {
         c = str[1] ^ 32;
         str += 2;
@@ -2259,13 +2260,17 @@ casemodify(char *str, int how)
         c = *str++;
         switch (how) {
         case CASMOD_LOWER:
-        if (isupper(c))
+        if (isupper(c)) {
             c = tolower(c);
+            mod = 1;
+        }
         break;

         case CASMOD_UPPER:
-        if (islower(c))
+        if (islower(c)) {
             c = toupper(c);
+            mod = 1;
+        }
         break;

         case CASMOD_CAPS:
@@ -2273,14 +2278,18 @@ casemodify(char *str, int how)
         if (!ialnum(c))
             nextupper = 1;
         else if (nextupper) {
-            if (islower(c))
+            if (islower(c)) {
             c = toupper(c);
+            mod = 1;
+            }
             nextupper = 0;
-        } else if (isupper(c))
+        } else if (isupper(c)) {
             c = tolower(c);
+            mod = 1;
+        }
         break;
         }
-        if (imeta(c)) {
+        if (mod && imeta(c)) {
         *ptr2++ = Meta;
         *ptr2++ = c ^ 32;
         } else


      parent reply	other threads:[~2022-04-04 18:53 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
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 ` Bart Schaefer [this message]

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=7YFW2UEchbS4BUmLaoFj4WomrJqG3eEhXsJz9KwYMuihA@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).