* [binutils-gdb] LoongArch: Commas inside double quotes
@ 2023-12-30 2:30 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-12-30 2:30 UTC (permalink / raw)
To: bfd-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3838f0bc107c48765059b3ca615f02077d961f39
commit 3838f0bc107c48765059b3ca615f02077d961f39
Author: Alan Modra <amodra@gmail.com>
Date: Thu Dec 28 22:12:17 2023 +1030
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:
---
opcodes/loongarch-coder.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
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 <http://www.gnu.org/licenses/>. */
#include "sysdep.h"
+#include <stdbool.h>
#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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-30 2:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-30 2:30 [binutils-gdb] LoongArch: Commas inside double quotes Alan Modra
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).