fix bug with zero length values

This commit is contained in:
Ville Rantanen
2017-03-17 10:36:07 +02:00
parent 469dd7a8b7
commit fe11cf120b

View File

@@ -60,10 +60,11 @@ else:
for l in in_reader: for l in in_reader:
for p in pairs: for p in pairs:
value=p[1] value=p[1]
if value[0]=="@": if len(value)>0:
value=open(value[1:],'rt').read() if value[0]=="@":
elif value[0:2]=="\\@": value=open(value[1:],'rt').read()
value=value[1:] elif value[0:2]=="\\@":
value=value[1:]
l=l.replace(p[0],value) l=l.replace(p[0],value)
if options.env: if options.env:
var_list=[m.group(0) for m in re.finditer('\${[^ ]+}', l)] var_list=[m.group(0) for m in re.finditer('\${[^ ]+}', l)]