do not abbreviate commands after abandon
authorStas Sergeev <stas@lin2.local>
Wed, 15 Dec 2010 15:21:11 +0000 (18:21 +0300)
committerStas P <stas@stas.(none)>
Wed, 15 Dec 2010 15:22:55 +0000 (18:22 +0300)
sst.py

diff --git a/sst.py b/sst.py
index 3a777e1c5ba0f5cbc0a7acba8a6087353b9cecd4..857f2b0209806f3c9d664344648cb5f8c56f4877 100755 (executable)
--- a/sst.py
+++ b/sst.py
@@ -5898,8 +5898,13 @@ def makemoves():
            clrscr()
            setwnd(message_window)
            clrscr()
            clrscr()
            setwnd(message_window)
            clrscr()
+           abandon_passed = False
            for (cmd, opt) in commands:
            for (cmd, opt) in commands:
-               if cmd.startswith(scanner.token.upper()):
+               # commands after ABANDON cannot be abbreviated
+               if cmd == "ABANDON":
+                   abandon_passed = True
+               if cmd == scanner.token.upper() or (not abandon_passed \
+                       and cmd.startswith(scanner.token.upper())):
                    break;
            if cmd == "":
                 listCommands()
                    break;
            if cmd == "":
                 listCommands()