Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: incarg: avoid unneeded subshell
- X-seq: zsh-workers 52546
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: incarg: avoid unneeded subshell
- Date: Fri, 16 Feb 2024 08:44:00 +0100
- Archived-at: <https://zsh.org/workers/52546>
- List-id: <zsh-workers.zsh.org>
---
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author