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"
};
static fs::path ASM_SOURCE_DIR = "src/asm";
static fs::path ASM_SOURCE_DIR = fs::path{"src"} / "asm";
static strvec ASM_SOURCES = {
"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 == '\"') {
/* not preceded by \, so it's safe */
ret += "\\\"";
++p;
} else {
/* handle any sequence of \ optionally followed by a " */
std::size_t nbsl = 0;
while (*p++ == '\\') {
++nbsl;
char const *op = p;
while (*p == '\\') {
++p;
}
if (*p == '\"') {
/* double all the backslashes plus one for the " */
ret.append(nbsl * 2 + 1, '\\');
ret.append((p - op) * 2 + 1, '\\');
ret += '\"';
} else {
ret.append(nbsl, '\\');
ret.append(p - op, '\\');
}
}
sp = p + 1;
sp = p;
}
ret += '\"';
}