Skip to content

Commit 1d62d1d

Browse files
fix blank line in batch file bug
1 parent 76d602b commit 1d62d1d

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

PyDOS.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ def setCondCmd(args,i,condResult):
585585
break
586586

587587
elif cmd == "VER":
588-
print("PyDOS [Version 1.02]")
588+
print("PyDOS [Version 1.03]")
589589

590590
elif cmd == "ECHO":
591591
if len(args) == 1:
@@ -1186,10 +1186,11 @@ def setCondCmd(args,i,condResult):
11861186
batIndex = [0]
11871187
batLabels = {}
11881188
for batLine in BATfile:
1189-
batIndex.append(batIndex[batLineNo]+len(batLine))
1190-
batLineNo += 1
1191-
if batLine.strip()[0] == ":" and len(batLine.strip().split(" ")[0]) > 1:
1192-
batLabels[batLine.strip().split(" ")[0][1:]] = [batLineNo,batIndex[batLineNo]]
1189+
if batline.strip() != "":
1190+
batIndex.append(batIndex[batLineNo]+len(batLine))
1191+
batLineNo += 1
1192+
if batLine.strip()[0] == ":" and len(batLine.strip().split(" ")[0]) > 1:
1193+
batLabels[batLine.strip().split(" ")[0][1:]] = [batLineNo,batIndex[batLineNo]]
11931194
BATfile.seek(0)
11941195
batLineNo = 0
11951196

0 commit comments

Comments
 (0)