Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Metafication in error messages (Was: [PATCH] unmetafy Re: $var not expanded in ${x?$var})



2024-02-22 07:23:13 +0000, Stephane Chazelas:
> 2024-02-21 16:46:23 -0800, Bart Schaefer:
> [...]
> >     Code	Argument types		Prints
> >     %s	const char *		C string (null terminated)
> > +   %S	const char *		C string (null terminated), output raw
> 
> May be worth pointing out there that the string is expected to
> be metafied (for both %s and %S).
> 
> >     %l	const char *, int	C string of given length (null not required)
> 
> Would that one be expected to be metafied?

I see it used in this error message:

$ printf '%d\n' $'1+|a\x83 c'
zsh: bad math expression: operand expected at `|a^@c'
0
$ printf '%d\n' $'1+|a\0b'
zsh: bad math expression: operand expected at `|a'
0
$ printf '%d\n' '1+|ÃÃÃÃÃÃ'
zsh: bad math expression: operand expected at `|\M-C\M-c\M-c\M-c\M-c\M-c\M-^C...'
0
$ ((1+|ÃÃÃÃÃÃ))
zsh: bad math expression: operand expected at `|ÃÃÃÃ\M-C...'

-- 
Stephane




Messages sorted by: Reverse Date, Date, Thread, Author