Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] unmetafy Re: $var not expanded in ${x?$var}
- X-seq: zsh-workers 52575
- From: Stephane Chazelas <stephane@xxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] unmetafy Re: $var not expanded in ${x?$var}
- Date: Thu, 22 Feb 2024 07:23:13 +0000
- Archived-at: <https://zsh.org/workers/52575>
- In-reply-to: <CAH+w=7ah2tG=QOFDVirAm2PdeX4CXqqjjc+0JinOAG_jkgR6sQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- Mail-followup-to: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>, zsh workers <zsh-workers@xxxxxxx>
- References: <20230113080246.nghigc4givvaomve@chazelas.org> <836025199.2014747.1673889335246@mail.virginmedia.com> <20240220070505.fd6jfbcdldieqv7u@chazelas.org> <CAH+w=7ajhNqwmbc_V3scgXTKJ+7BJsii3r4=q+df84-MntxNng@mail.gmail.com> <20240220193911.avnmcqfliwltkj5m@chazelas.org> <CAH+w=7YmczEa2rNa68OwUhiRArBFJ11FdwT6Qci_LmTAWFauGg@mail.gmail.com> <20240221194534.o2mufin7orng6ttg@chazelas.org> <CAH+w=7Z0Evb019EX=bLtgHh0UOPy1J-nUO5paz+AxDXTtVGNSw@mail.gmail.com> <20240221202150.tccftcqbxqqexq4x@chazelas.org> <CAH+w=7ah2tG=QOFDVirAm2PdeX4CXqqjjc+0JinOAG_jkgR6sQ@mail.gmail.com>
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