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

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