From df27d2ac52bba33c541119caa3a1dc9d83690079 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 9 Apr 2021 18:42:08 +0200 Subject: Escape additional characters (=,;) if running batch file --- libbutl/process.mxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libbutl/process.mxx') diff --git a/libbutl/process.mxx b/libbutl/process.mxx index 9106549..ab5e84f 100644 --- a/libbutl/process.mxx +++ b/libbutl/process.mxx @@ -503,13 +503,15 @@ LIBBUTL_MODEXPORT namespace butl static void print (std::ostream&, const char* const args[], size_t n = 0); - // Quote and escape the specified command line argument. Return the - // original string if neither is necessary and a pointer to the provided - // buffer string containing the escaped version otherwise. + // Quote and escape the specified command line argument. If batch is true + // then also quote the equal (`=`), comma (`,`) and semicolon (`;`) + // characters which are treated as argument separators in batch file. + // Return the original string if neither is necessary and a pointer to the + // provided buffer string containing the escaped version otherwise. // #ifdef _WIN32 static const char* - quote_argument (const char*, std::string& buffer); + quote_argument (const char*, std::string& buffer, bool batch); #endif public: -- cgit v1.1