Blame SOURCES/bz2102493-fix-variable-substitution.patch

1b46c7
From 332262ec91f85cd4224816d2803d818015239007 Mon Sep 17 00:00:00 2001
1b46c7
From: Quentin Armitage <quentin@armitage.org.uk>
1b46c7
Date: Wed, 29 Jun 2022 09:18:15 +0100
1b46c7
Subject: [PATCH] parser: optimise fixing recalculating updated line length
1b46c7
1b46c7
Commit 1ffad9a - "recalculate buffer length inside recheck loop"
1b46c7
resolved the issue but calls strlen(buf) more often than necessary.
1b46c7
1b46c7
This commit only calls strlen(buf) when the line buffer is modified.
1b46c7
1b46c7
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
1b46c7
---
1b46c7
 lib/parser.c | 3 +++
1b46c7
 1 file changed, 3 insertions(+)
1b46c7
1b46c7
diff --git a/lib/parser.c b/lib/parser.c
1b46c7
index bcabd07f..2146f38b 100644
1b46c7
--- a/lib/parser.c
1b46c7
+++ b/lib/parser.c
1b46c7
@@ -2809,6 +2809,9 @@ read_line(char *buf, size_t size)
1b46c7
 					recheck = true;
1b46c7
 				if (strchr(buf, '$'))
1b46c7
 					recheck = true;
1b46c7
+
1b46c7
+				if (recheck)
1b46c7
+					len = strlen(buf);
1b46c7
 			}
1b46c7
 		} while (recheck);
1b46c7
 	} while (buf[0] == '\0' || check_include(buf));
1b46c7
-- 
1b46c7
2.38.1
1b46c7