mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Update shell argument escape.
This commit is contained in:
committed by
Christoffer Lerno
parent
ac95e411bc
commit
5e2a06bfd6
@@ -778,9 +778,7 @@ static char *assemble_linker_command(const char **args, bool extra_quote)
|
||||
assert(arg != scratch_buffer.str && "Incorrectly passed a scratch buffer string as an argument.");
|
||||
if (arg == quote_arg)
|
||||
{
|
||||
scratch_buffer_append_char('"');
|
||||
scratch_buffer_append_in_quote(args[++i]);
|
||||
scratch_buffer_append_char('"');
|
||||
scratch_buffer_append_cmd_argument(args[++i]);
|
||||
continue;
|
||||
}
|
||||
if (arg == concat_arg)
|
||||
@@ -791,25 +789,15 @@ static char *assemble_linker_command(const char **args, bool extra_quote)
|
||||
}
|
||||
if (arg == concat_file_arg)
|
||||
{
|
||||
scratch_buffer_append_char('"');
|
||||
const char *a = args[++i];
|
||||
scratch_buffer_append_in_quote(a);
|
||||
size_t len = strlen(a);
|
||||
char c = len ? a[len - 1] : '/';
|
||||
if (c != '/' && !(PLATFORM_WINDOWS && c == '\\'))
|
||||
{
|
||||
scratch_buffer_append(PLATFORM_WINDOWS ? "\\\\" : "/");
|
||||
}
|
||||
scratch_buffer_append_in_quote(args[++i]);
|
||||
scratch_buffer_append_char('"');
|
||||
const char *path = file_append_path_temp(a, args[++i]);
|
||||
scratch_buffer_append_cmd_argument(path);
|
||||
continue;
|
||||
}
|
||||
if (arg == concat_quote_arg)
|
||||
{
|
||||
scratch_buffer_append(args[++i]);
|
||||
scratch_buffer_append_char('"');
|
||||
scratch_buffer_append_in_quote(args[++i]);
|
||||
scratch_buffer_append_char('"');
|
||||
scratch_buffer_append_cmd_argument(args[++i]);
|
||||
continue;
|
||||
}
|
||||
scratch_buffer_append(arg);
|
||||
|
||||
Reference in New Issue
Block a user