Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zargs error with some combinations of arguments
- X-seq: zsh-workers 50495
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Alan Wagner-Krankel <awk@xxxxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: zargs error with some combinations of arguments
- Date: Mon, 22 Aug 2022 14:31:57 -0700
- Archived-at: <https://zsh.org/workers/50495>
- In-reply-to: <CAGZNKjKKfA3yS1HRBTgij1DtU0EB4OVx9GxsQq6i1=rnBUfUug@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAGZNKjKKfA3yS1HRBTgij1DtU0EB4OVx9GxsQq6i1=rnBUfUug@mail.gmail.com>
On Thu, Aug 18, 2022 at 7:12 PM Alan Wagner-Krankel <awk@xxxxxxxxxxx> wrote:
>
> count:256 length:20479
> zargs: cannot fit single argument within size limit
>
> + (( a = s - ${#:-"$command "} ))
> + if (( a <= 0 ))
> + then
> + print -u2 'zargs: value for max-chars must be >= command length'
> + return 1
> + fi
Isn't that just trading one error message for a different one?
The below would seem to make more sense, is there something I missed?
diff --git a/Functions/Misc/zargs b/Functions/Misc/zargs
index 782d6811e..2f5447917 100644
--- a/Functions/Misc/zargs
+++ b/Functions/Misc/zargs
@@ -305,7 +305,7 @@ do
repeat $P
do
((ARGC)) || break
- for (( end=l; end && ${(c)#argv[1,end]} > s; end/=2 )) { }
+ for (( end=l; end && ${(c)#argv[1,end]} > s - $#command; end/=2 )) { }
(( end > n && ( end = n ) ))
args=( "${(@)argv[1,end]}" )
shift $((end > ARGC ? ARGC : end))
Messages sorted by:
Reverse Date,
Date,
Thread,
Author