zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-workers@sunsite.dk
Subject: Re: Regression in UTF-8 support
Date: Mon, 26 Sep 2005 19:37:03 +0100	[thread overview]
Message-ID: <20050926193703.6cc92722.pws@csr.com> (raw)
In-Reply-To: <200509252005.41824.arvidjaar@newmail.ru>

Andrey Borzenkov <arvidjaar@newmail.ru> wrote:
> I did not really need Russian filenames until recently; with quite
> unexpected results. The following is in UTF; please compare file listing
> with completion listing (ignore obvious formatting error):
>...
> so something mangles characters (d184 -> d183, d18b -> d183 etc), moreover, 
> parsing stops at this character (d183)

I think this improves matters, but whether it's the whole thing I don't
know.  It's a simple interface issue.  I'm now less convinced I should have
let stringaszleline() operate in place.

Index: Src/Zle/zle_hist.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_hist.c,v
retrieving revision 1.27
diff -u -r1.27 zle_hist.c
--- Src/Zle/zle_hist.c	15 Aug 2005 10:01:50 -0000	1.27
+++ Src/Zle/zle_hist.c	26 Sep 2005 18:34:59 -0000
@@ -75,6 +75,8 @@
 static void
 zletext(Histent ent, struct zle_text *zt)
 {
+    char *duptext;
+
     if (ent->zle_text) {
 	zt->text = ent->zle_text;
 	zt->len = ent->zle_len;
@@ -82,8 +84,10 @@
 	return;
     }
 
-    zt->text = stringaszleline((unsigned char *)ent->text, 0,
+    duptext = ztrdup(ent->text);
+    zt->text = stringaszleline((unsigned char *)duptext, 0,
 			       &zt->len, NULL, NULL);
+    zsfree(duptext);
     zt->alloced = 1;
 }
 


-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************


  parent reply	other threads:[~2005-09-26 18:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-25 16:05 Andrey Borzenkov
2005-09-25 21:56 ` Mikael Magnusson
2005-09-26 18:37 ` Peter Stephenson [this message]
2005-09-26 18:53   ` Andrey Borzenkov
2005-09-27 14:22     ` Peter Stephenson
2005-09-27 17:00       ` Mikael Magnusson
2005-09-28  3:04         ` Andrey Borzenkov
2005-09-28 10:15           ` Peter Stephenson
2005-09-28 10:22             ` Peter Stephenson
2005-09-28 14:45               ` 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=20050926193703.6cc92722.pws@csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.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).