]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdbsupport/common-inferior.c: Fix mingw build
authorLancelot SIX <lancelot.six@amd.com>
Mon, 31 Mar 2025 11:06:06 +0000 (12:06 +0100)
committerLancelot SIX <lancelot.six@amd.com>
Mon, 31 Mar 2025 13:03:33 +0000 (14:03 +0100)
A recent change (512ca2fca4b "gdb: split up
construct_inferior_arguments") introduced a build failure for mingw:

      CXX      common-inferior.o
    .../gdb/gdbsupport/common-inferior.cc: In function ‘std::string escape_characters(const char*, const char*)’:
    .../gdb/gdbsupport/common-inferior.cc:62:20: error: ‘argv’ was not declared in this scope; did you mean ‘arg’?
       62 |       if (strpbrk (argv[i], special))
          |                    ^~~~
          |                    arg
    .../gdb/gdbsupport/common-inferior.cc:62:25: error: ‘i’ was not declared in this scope
       62 |       if (strpbrk (argv[i], special))
          |                         ^

This patch fixes that.

Change-Id: I07ade607bc4516627b433085b07d9d198d8e4b4a
Approved-By: Tom de Vries <tdevries@suse.de>
gdbsupport/common-inferior.cc

index 4b8682940626a9f6a4d43d33c72478f0eb821ac1..e544780bd4b4eb5c9cf21518fd6449de3f7274a9 100644 (file)
@@ -59,7 +59,7 @@ escape_characters (const char *arg, const char *special)
 #ifdef __MINGW32__
       bool quoted = false;
 
-      if (strpbrk (argv[i], special))
+      if (strpbrk (arg, special))
        {
          quoted = true;
          result += quote;