2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-07-02 14:02:27 +00:00

busybox: fix awk %% error. Closes #331

This commit is contained in:
Dylan Araps 2021-09-10 18:24:41 +03:00
parent b31d9d37a1
commit 139c13dcbb
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C
4 changed files with 24 additions and 1 deletions

View File

@ -7,6 +7,7 @@ f0e17fefc0af6b10205d72b242b6ef7481a58ff07726c62890ebc5893b96a396
73be7b16dcff44e88eb48696522794f529beddf9d5a139b8a76cc8685a9f6fc8
d70c4cd6381baeb3836c0387f53553021b48bdc851de49f1c86d836f7d0355fc
b030d6ac2b3284cf3cc0a2eec886d26b7e09ea59feb460a6a09165da62a582b4
fc5e47e82765dc43c0b271156d40cf80148fb67b55c935e6f61a0e052ba49e40
c8a6fc95a75fa355d570c14e214d68a618e060a486b824b83b5140b9c6a894a7
5f3d6cbdc7060deab644555201365e6dd15ffed07d341532c3d82a170e95c0bd
423c3a67ad56b290ef73440cb748dbc3c6ee2ec486683b5e19242a804db8085b

View File

@ -0,0 +1,21 @@
diff --git a/editors/awk.c b/editors/awk.c
index 3adbca7..f7b8ef0 100644
--- a/editors/awk.c
+++ b/editors/awk.c
@@ -2346,8 +2346,15 @@ static char *awk_printf(node *n, size_t *len)
size_t slen;
s = f;
- while (*f && (*f != '%' || *++f == '%'))
+ while (*f && *f != '%')
f++;
+ c = *++f;
+ if (c == '%') { /* double % */
+ slen = f - s;
+ s = xstrndup(s, slen);
+ f++;
+ goto tail;
+ }
while (*f && !isalpha(*f)) {
if (*f == '*')
syntax_error("%*x formats are not supported");

View File

@ -7,6 +7,7 @@ patches/install-fix-chown.patch patch
patches/lsusb-vendor-product.patch patch
patches/unzip-usage-no-error.patch patch
patches/init-use-baseinit.patch patch
patches/awk-fix-%%.patch patch
patches/fix-UB.patch patch-clang
files/.config
files/.config-suid

View File

@ -1 +1 @@
1.34.0 4
1.34.0 5