festivecasual / sigma-mud

Experimental MUD server in Python
0 stars 0 forks source link

Capitalized commands are incorrectly parsed #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Type SAY SOMETHING in all caps.
2. output will be: You say, 'Y SOMETHING'
3. Should be: You say, 'SOMETHING'

Occurs only when one or more of the of the letters of the command are
capitalized.

Original issue reported on code.google.com by meagains...@gmail.com on 12 Dec 2008 at 12:28

GoogleCodeExporter commented 9 years ago
This is fixed. See r113. Changed:

tail = message[(message.find(tokens[0]) + len(tokens[0])):].lstrip()

to 

tail = message[(message.lower().find(tokens[0]) + len(tokens[0])):].lstrip()

which fixes the problem where you would never find tokens[0] because token was
populated from a lower() version of message if the command was typed in in all 
caps.

Original comment by meagains...@gmail.com on 29 Jan 2009 at 4:50