Han Boetes <[email protected]> writes:

> Otto Moerbeek wrote:
>> > case "foobar" in
>> >   *[5-~]*) echo "Why do I match now?" ;;
>> > esac
>> > 
>> > What is going on here?
>> 
>> You specify the range 5 ... ~, which includes all letters. See ascii(5).
>
> Ah, silly me, it's a range! OK, this brings me to the real problem: This
> comes from a recent version of configure in emacs which tries to test
> for dirs with non-ascii characters:

Why do they care...

> temp_srcdir=`cd "$srcdir"; pwd`
>
> for var in "`pwd`" "$temp_srcdir" "$prefix" "$exec_prefix" \
>     "$datarootdir" "$bindir" "$datadir" "$sharedstatedir" "$libexecdir"; do
>
>     case "$var" in
>     *[^\ -~]*) as_fn_error $? "Emacs cannot be built or installed in a 
> directory whose name contains non-ASCII characters: $var" "$LINENO" 5 ;;
>   esac
>
> done

non-ASCII...

> Which can be reduced to:
>
> #!/bin/sh
> case "foobar" in
>   *[^\ -~]*) echo "Why do I match now?" ;;
> esac
>
> Which seems like a valid test for the range of ascii characters. But it
> fails with ksh and not with bash and zsh:
>
> ~% sh ./test.sh
> Why do I match now?
> ~% zsh ./test.sh
> ~% bash ./test.sh
>
> What's going on here?

[!set] is more portable than [^set].

-- 
jca | PGP : 0x06A11494 / 61DB D9A0 00A4 67CF 2A90  8961 6191 8FBF 06A1 1494

Reply via email to