1
0
Fork 0

builtin functions: parser not traceback if func expands to empty string

Fixes the following:
[variables]
v=${f:f1:}

if 'f1' expands to empty string it doesn't traceback now.

Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
Jaroslav Škarvada 2017-04-11 17:27:43 +02:00
parent e8f42a2c3f
commit 94b7fdd41d
No known key found for this signature in database
GPG key ID: D8E1C00E076E840B

View file

@ -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]