zsh-workers
 help / color / mirror / code / Atom feed
* Probable bug in zsh 4.x
@ 2003-12-02 23:42 Ulrik Haugen
  2003-12-03 10:47 ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Ulrik Haugen @ 2003-12-02 23:42 UTC (permalink / raw)
  To: zsh-workers


Hi all!

I think I've found a bug in zsh versions 4.0.7 and 4.1.1.

Globbing with character classes doesn't work with local Swedish
characters (åäöÅÄÖ). As you can see my test gives the desired result
in zsh 3.0.8, and I also get the same result in /bin/sh from SunOS
5.8.

------------------------------ 8< ------------------------------
haugen% cat zshexpn.test   
# -*- mode:sh; sh-shell: zsh; -*-

echo $ZSH_VERSION

for name in anders björn; do
    case $name in
        *[åäöÅÄÖ]*)
        echo "$name contains one or more of 'åäöÅÄÖ'"
        ;;
        *[b]*)
        echo "$name contains one or more 'b'"
        ;;
    esac
done
haugen% zsh30 zshexpn.test   
3.0.8
björn contains one or more of 'åäöÅÄÖ'
haugen% zsh zshexpn.test     
4.0.7
björn contains one or more 'b'
haugen% zsh-beta zshexpn.test
4.1.1
björn contains one or more 'b'
haugen% 
------------------------------ 8< ------------------------------

-- 
Ulrik Haugen <qha@lysator.liu.se>
"It's a poor laser blaster that doesn't work both ways"
        -- Salvor Hardin through Isaac Asimov


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

* Re: Probable bug in zsh 4.x
  2003-12-02 23:42 Probable bug in zsh 4.x Ulrik Haugen
@ 2003-12-03 10:47 ` Peter Stephenson
  2003-12-03 16:51   ` Bart Schaefer
  2003-12-03 21:54   ` Ulrik Haugen
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Stephenson @ 2003-12-03 10:47 UTC (permalink / raw)
  To: Ulrik Haugen; +Cc: zsh-workers

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2496 bytes --]

Ulrik Haugen wrote:
> I think I've found a bug in zsh versions 4.0.7 and 4.1.1.
> 
> Globbing with character classes doesn't work with local Swedish
> characters.

Thanks, that's been around ever since the pattern code was rewritten.
It would only show up where chars are signed.  See if this makes it go
away.

Index: Src/pattern.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/pattern.c,v
retrieving revision 1.15
diff -u -r1.15 pattern.c
--- Src/pattern.c	29 Oct 2003 19:17:30 -0000	1.15
+++ Src/pattern.c	3 Dec 2003 10:44:10 -0000
@@ -2265,7 +2265,7 @@
 		DPUTS(1, "BUG: unknown metacharacter in range.");
 		break;
 	    }
-	} else if (*range == ch)
+	} else if (STOUC(*range) == ch)
 	    return 1;
     }
     return 0;
Index: Misc/globtests
===================================================================
RCS file: /cvsroot/zsh/zsh/Misc/globtests,v
retrieving revision 1.2
diff -u -r1.2 globtests
--- Misc/globtests	6 Apr 2000 18:44:01 -0000	1.2
+++ Misc/globtests	3 Dec 2003 10:44:11 -0000
@@ -179,5 +179,6 @@
 f path/testy    *((#s)|/)test((#e)|/)*
 f path/testy/ohyes *((#s)|/)test((#e)|/)*
 f path/atest/ohyes *((#s)|/)test((#e)|/)*
+t björn		*[åäöÅÄÖ]*
 EOT
 print "$failed tests failed."
Index: Test/D02glob.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/D02glob.ztst,v
retrieving revision 1.2
diff -u -r1.2 D02glob.ztst
--- Test/D02glob.ztst	26 Mar 2003 17:33:40 -0000	1.2
+++ Test/D02glob.ztst	3 Dec 2003 10:44:11 -0000
@@ -174,6 +174,7 @@
 >1:  [[ path/testy = *((#s)|/)test((#e)|/)* ]]
 >1:  [[ path/testy/ohyes = *((#s)|/)test((#e)|/)* ]]
 >1:  [[ path/atest/ohyes = *((#s)|/)test((#e)|/)* ]]
+>0:  [[ björn = *[åäöÅÄÖ]* ]]
 >0 tests failed.
 
   globtest globtests.ksh

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, 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.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


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

* Re: Probable bug in zsh 4.x
  2003-12-03 10:47 ` Peter Stephenson
@ 2003-12-03 16:51   ` Bart Schaefer
  2003-12-03 21:54   ` Ulrik Haugen
  1 sibling, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2003-12-03 16:51 UTC (permalink / raw)
  To: zsh-workers

On Dec 3, 10:47am, Peter Stephenson wrote:
}
} It would only show up where chars are signed.  See if this makes it go
} away.

That appears to have done it, yes.


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

* Re: Probable bug in zsh 4.x
  2003-12-03 10:47 ` Peter Stephenson
  2003-12-03 16:51   ` Bart Schaefer
@ 2003-12-03 21:54   ` Ulrik Haugen
  1 sibling, 0 replies; 4+ messages in thread
From: Ulrik Haugen @ 2003-12-03 21:54 UTC (permalink / raw)
  To: zsh-workers

Peter Stephenson <pws@csr.com> writes:
> Thanks, that's been around ever since the pattern code was rewritten.
> It would only show up where chars are signed.  See if this makes it go
> away.

Yes, that seems to have done the trick for me as well. Thanks!


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

end of thread, other threads:[~2003-12-03 21:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-02 23:42 Probable bug in zsh 4.x Ulrik Haugen
2003-12-03 10:47 ` Peter Stephenson
2003-12-03 16:51   ` Bart Schaefer
2003-12-03 21:54   ` Ulrik Haugen

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