From: Alan Modra Date: Thu, 28 Dec 2023 11:42:17 +0000 (+1030) Subject: LoongArch: Commas inside double quotes X-Git-Tag: binutils-2_42~333 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3838f0bc107c48765059b3ca615f02077d961f39;p=thirdparty%2Fbinutils-gdb.git LoongArch: Commas inside double quotes This adds an extra feature: Commas inside double quotes are not an arg delimiter, and thus can be part of the arg. * loongarch-coder.c (loongarch_split_args_by_comma): Commas inside quotes are not arg delimiters. --- diff --git a/opcodes/loongarch-coder.c b/opcodes/loongarch-coder.c index b68352769ca..c5b09509964 100644 --- a/opcodes/loongarch-coder.c +++ b/opcodes/loongarch-coder.c @@ -18,6 +18,7 @@ along with this program; see the file COPYING3. If not, see . */ #include "sysdep.h" +#include #include "opcode/loongarch.h" int @@ -256,9 +257,12 @@ loongarch_split_args_by_comma (char *args, const char *arg_strs[]) if (*args) { + bool inquote = false; arg_strs[num++] = args; for (; *args; args++) - if (*args == ',') + if (*args == '"') + inquote = !inquote; + else if (*args == ',' && !inquote) { if (MAX_ARG_NUM_PLUS_2 - 1 == num) goto out;