* PATCH: incarg: avoid unneeded subshell
@ 2024-02-16 7:44 Mikael Magnusson
0 siblings, 0 replies; only message in thread
From: Mikael Magnusson @ 2024-02-16 7:44 UTC (permalink / raw)
To: zsh-workers
---
I only tried the basic functionality, but I don't see any reason we can't do this?
Also, under what circumstances would an error be printed here?
Functions/Zle/incarg | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Functions/Zle/incarg b/Functions/Zle/incarg
index 1131b148b4..9d56b21f6d 100644
--- a/Functions/Zle/incarg
+++ b/Functions/Zle/incarg
@@ -214,8 +214,7 @@ case "$base" in
esac
local raw_result padded
-raw_result="$( \
- printf "%0$ndigits$fmt1" $(( [$fmt2] "$base#$old" + delta )) 2> /dev/null)"
+printf -v raw_result "%0$ndigits$fmt1" $(( [$fmt2] "$base#$old" + delta )) 2> /dev/null
padded="${raw_result// /0}"
integer oldnum="$base#$old" newnum="$base#$padded" 2> /dev/null
--
2.38.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-02-16 7:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-16 7:44 PATCH: incarg: avoid unneeded subshell Mikael Magnusson
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).