Fix env buffer parsing

pull/3/head
remittor 3 years ago
parent 8915461e5a
commit 3cf3782aea

@ -24,8 +24,7 @@ class EnvBuffer():
self.delim = delim
self.crc_prefix = crc_prefix
self.var = {}
if data is None:
return
if data is not None:
prefix_len = 4 if crc_prefix else 0
if isinstance(data, str):
self.var = self.parse_env(data, delim)
@ -67,9 +66,9 @@ class EnvBuffer():
if x == 0:
continue
if x >= 1:
key = s[0:x]
val = s[x+1:]
dict[key.strip()] = val.strip()
key = (s[0:x]).strip()
if key:
dict[key] = (s[x+1:]).strip()
else:
dict[s.strip()] = None
return dict

Loading…
Cancel
Save