From 94b7fdd41d49e452c394c37f0060314d22423ba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Tue, 11 Apr 2017 17:27:43 +0200 Subject: [PATCH] builtin functions: parser not traceback if func expands to empty string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following: [variables] v=${f:f1:} if 'f1' expands to empty string it doesn't traceback now. Signed-off-by: Jaroslav Škarvada --- tuned/profiles/functions/functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuned/profiles/functions/functions.py b/tuned/profiles/functions/functions.py index acf7077..aa8359b 100644 --- a/tuned/profiles/functions/functions.py +++ b/tuned/profiles/functions/functions.py @@ -27,7 +27,7 @@ class Functions(): self._esc = False def _curr_char(self): - return self._str[self._cnt] + return self._str[self._cnt] if self._cnt < self._len else "" def _curr_substr(self, _len): return self._str[self._cnt:self._cnt + _len]