more windows fixes

master
Daniel Kolesa 2017-05-09 22:37:00 +02:00
parent 5f12c8f0b9
commit 2bab256b4d
2 changed files with 8 additions and 7 deletions

View File

@ -37,7 +37,7 @@ static std::vector<std::string> EXAMPLES = {
"stream1", "stream2", "coroutine1", "coroutine2", "concurrency" "stream1", "stream2", "coroutine1", "coroutine2", "concurrency"
}; };
static fs::path ASM_SOURCE_DIR = "src/asm"; static fs::path ASM_SOURCE_DIR = fs::path{"src"} / "asm";
static strvec ASM_SOURCES = { static strvec ASM_SOURCES = {
"jump_all_gas", "make_all_gas", "ontop_all_gas" "jump_all_gas", "make_all_gas", "ontop_all_gas"
}; };

View File

@ -479,21 +479,22 @@ static std::string concat_args(std::vector<std::string> const &args) {
if (*p == '\"') { if (*p == '\"') {
/* not preceded by \, so it's safe */ /* not preceded by \, so it's safe */
ret += "\\\""; ret += "\\\"";
++p;
} else { } else {
/* handle any sequence of \ optionally followed by a " */ /* handle any sequence of \ optionally followed by a " */
std::size_t nbsl = 0; char const *op = p;
while (*p++ == '\\') { while (*p == '\\') {
++nbsl; ++p;
} }
if (*p == '\"') { if (*p == '\"') {
/* double all the backslashes plus one for the " */ /* double all the backslashes plus one for the " */
ret.append(nbsl * 2 + 1, '\\'); ret.append((p - op) * 2 + 1, '\\');
ret += '\"'; ret += '\"';
} else { } else {
ret.append(nbsl, '\\'); ret.append(p - op, '\\');
} }
} }
sp = p + 1; sp = p;
} }
ret += '\"'; ret += '\"';
} }