From f140b9b68c983db6373758f8d8dfb7b980ff8593 Mon Sep 17 00:00:00 2001 From: Nicholas O'Connor Date: Mon, 27 Mar 2017 23:17:00 -0700 Subject: [PATCH] fixed escaping bug in commands.cpp cogs --- src/bottles/commands.cpp.cog | 4 ++-- src/commands.cpp.cog | 4 ++-- src/launch/commands.cpp.cog | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bottles/commands.cpp.cog b/src/bottles/commands.cpp.cog index 2b5384a..8d07562 100644 --- a/src/bottles/commands.cpp.cog +++ b/src/bottles/commands.cpp.cog @@ -29,8 +29,8 @@ DLL_PUBLIC map 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)) diff --git a/src/commands.cpp.cog b/src/commands.cpp.cog index bc1dee8..d65f9bf 100644 --- a/src/commands.cpp.cog +++ b/src/commands.cpp.cog @@ -39,8 +39,8 @@ map 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)) diff --git a/src/launch/commands.cpp.cog b/src/launch/commands.cpp.cog index adba1a9..65c940c 100644 --- a/src/launch/commands.cpp.cog +++ b/src/launch/commands.cpp.cog @@ -29,8 +29,8 @@ DLL_PUBLIC map 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))