Skip to content

Commit 56a2285

Browse files
committed
Fix strip and split to allow for significant space in STRING
1 parent c04a7c4 commit 56a2285

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_ducky.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def __init__(
134134

135135
with open(filename, "r") as duckyscript:
136136
for line in duckyscript:
137-
line = line.strip(" \n\r")
137+
line = line.lstrip(" ").rstrip("\n\r")
138138
if len(line) > 0:
139139
self.lines.append(line)
140140

@@ -193,7 +193,7 @@ def loop( # pylint: disable=too-many-return-statements
193193

194194
self.write_key(start)
195195
if len(words) > 1:
196-
for key in words[1].split(" "):
196+
for key in filter(None, words[1].split(" ")):
197197
self.write_key(key)
198198

199199
self.keyboard.release_all()

0 commit comments

Comments
 (0)