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

Re: zargs error with some combinations of arguments



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