fixed escaping bug in commands.cpp cogs

This commit is contained in:
Nicholas O'Connor 2017-03-27 23:17:00 -07:00
parent bfffa2dd7f
commit f140b9b68c
3 changed files with 6 additions and 6 deletions

View File

@ -29,8 +29,8 @@ DLL_PUBLIC map<string, CommandFunction> cellar::commands::bottles_commands() {
desc = " ".join(linesplit[2:]) # Rest of line assumed to be description
cog.outl("cellar::help::set_description(\"{0}\", \"{1}\");"
.format(name, desc
.replace("\"", "\\\"")
.replace("\\", "\\\\")))
.replace("\\", "\\\\")
.replace("\"", "\\\"")))
# the replace methods escape " and \ characters
else:
print("-- No description is available for the {0} command.".format(name))

View File

@ -39,8 +39,8 @@ map<string, CommandFunction> cellar::commands::core_commands() {
desc = " ".join(linesplit[2:]) # Rest of line assumed to be description
cog.outl("cellar::help::set_description(\"{0}\", \"{1}\");"
.format(name, desc
.replace("\"", "\\\"")
.replace("\\", "\\\\")))
.replace("\\", "\\\\")
.replace("\"", "\\\"")))
# the replace methods escape " and \ characters
else:
print("-- No description is available for the {0} command.".format(name))

View File

@ -29,8 +29,8 @@ DLL_PUBLIC map<string, CommandFunction> cellar::commands::launch_commands() {
desc = " ".join(linesplit[2:]) # Rest of line assumed to be description
cog.outl("cellar::help::set_description(\"{0}\", \"{1}\");"
.format(name, desc
.replace("\"", "\\\"")
.replace("\\", "\\\\")))
.replace("\\", "\\\\")
.replace("\"", "\\\"")))
# the replace methods escape " and \ characters
else:
print("-- No description is available for the {0} command.".format(name))