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

Re: [PATCH] unmetafy Re: $var not expanded in ${x?$var}



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?

>     %L	long			decimal value
>     %d	int			decimal value
> @@ -309,6 +310,10 @@ zerrmsg(FILE *file, const char *fmt, va_list ap)
>  		str = va_arg(ap, const char *);
>  		nicezputs(str, file);
>  		break;
> +	    case 'S':
> +		str = va_arg(ap, const char *);
> +		fwrite(unmetafy(dupstring(str), &num), num, 1, file);
> +		break;
[...]

Being no C expert, I wonder if it's safe (portable) to set and
use num in the same call like that. Is it guaranteed to be done
in the right order?

-- 
Stephane




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