zsh-workers
 help / color / mirror / code / Atom feed
* Re: Bug#353607: Related problem?
       [not found] <200710192118.22845.gn@oglaroon.de>
@ 2007-10-19 19:52 ` Clint Adams
  2007-10-22  9:17   ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Adams @ 2007-10-19 19:52 UTC (permalink / raw)
  To: Georg Neis, 353607; +Cc: zsh-workers

On Fri, Oct 19, 2007 at 09:18:22PM +0200, Georg Neis wrote:
> I wanted to report the following bug and came across this report.  It 
> may be related.

No, I think this is not the same thing.

It looks like something is transforming the à to Ã� and failing to find
it.

> traal% ls -a
> ./  ../
> traal% mkdir a b
> traal% touch a/1 b/1
> traal% print -l *(F)
> a
> b
> traal% mv a à
> traal% print -l *(F)
> b


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug#353607: Related problem?
  2007-10-19 19:52 ` Bug#353607: Related problem? Clint Adams
@ 2007-10-22  9:17   ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2007-10-22  9:17 UTC (permalink / raw)
  To: zsh-workers; +Cc: Georg Neis, 353607

On Fri, 19 Oct 2007 15:52:45 -0400
Clint Adams <schizo@debian.org> wrote:
> On Fri, Oct 19, 2007 at 09:18:22PM +0200, Georg Neis wrote:
> > traal% ls -a
> > ./  ../
> > traal% mkdir a b
> > traal% touch a/1 b/1
> > traal% print -l *(F)
> > a
> > b
> > traal% mv a à
> > traal% print -l *(F)
> > b

We don't unmetafy strings passed down to glob qualifier functions.
This appears to be correct in some cases (where the name is passed into
shell code for further processing), so it seems we need to do this within
qualnonemptydir().  (I left the first hunk in as it's a little neater
but it has no effect.)

Index: Src/glob.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/glob.c,v
retrieving revision 1.59
diff -u -r1.59 glob.c
--- Src/glob.c	18 Jun 2007 13:25:05 -0000	1.59
+++ Src/glob.c	22 Oct 2007 09:15:07 -0000
@@ -326,7 +326,8 @@
 	    /* Reject the file if the function returned zero *
 	     * and the sense was positive (sense&1 == 0), or *
 	     * vice versa.                                   */
-	    if ((!((qn->func) (news, bp, qn->data, qn->sdata)) ^ qn->sense) & 1) {
+	    if ((!((qn->func) (news, bp, qn->data, qn->sdata))
+		 ^ qn->sense) & 1) {
 		/* Try next alternative, or return if there are no more */
 		if (!(qo = qo->or)) {
 		    unqueue_signals();
@@ -3254,6 +3255,8 @@
 {
     DIR *dirh;
     struct dirent *de;
+    int unamelen;
+    char *uname = unmetafy(dupstring(name), &unamelen);
 
     if (!S_ISDIR(buf->st_mode))
 	return 0;
@@ -3261,7 +3264,7 @@
     if (buf->st_nlink > 2)
 	return 1;
 
-    if (!(dirh = opendir(name)))
+    if (!(dirh = opendir(uname)))
 	return 0;
 
     while ((de = readdir(dirh))) {


-- 
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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-10-22  9:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200710192118.22845.gn@oglaroon.de>
2007-10-19 19:52 ` Bug#353607: Related problem? Clint Adams
2007-10-22  9:17   ` Peter Stephenson

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).