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

Re: PATCH: Improve quote handling in _ant completion




I checked and this works. Even just using 'print -qn' works.

Questions:
1. Is "${(qq):-$ln} equivalent to "${(qq)ln} ?
2. Does the read command needs '-r' ?
3. Does using eval creates the risk of arbitrary execution of code?


On Wednesday, November 29, 2023 at 03:45:08 PM PST, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:


On Wed, Nov 29, 2023 at 11:56 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> On 11/29/23, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> > -                    print -n "'${default_target}:(Default target) ' "
> > +                    print -rn -- "${(qq):-${default_target}:(Default target) } "

A similar change needs to be applied a bit later, I think:

                (*)
                    # Return target and description
-                    print -n "'$ln' "
+                    print -rn -- "${(qq):-$ln} "
                ;;

If this seems OK I'll prepare a proper patch.


> >> Also I am proposing to shield 'find_targets' with '((
> >> $#functions[find_targets] )) ||' so that users can easily override the
> >> function.
>
> It should probably also be renamed to _ant_find_targets or something


Agreed.



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