PR29262, memory leak in pr_function_type
[binutils-gdb.git] / gdb / ser-pipe.c
index 257e0d4a10705cec04933dfb9b93bf9bc012189e..80bb73e041826b6723de448db140139f05813e7a 100644 (file)
@@ -1,5 +1,5 @@
 /* Serial interface for a pipe to a separate program
-   Copyright (C) 1999-2021 Free Software Foundation, Inc.
+   Copyright (C) 1999-2022 Free Software Foundation, Inc.
 
    Contributed by Cygnus Solutions.
 
@@ -62,6 +62,12 @@ pipe_open (struct serial *scb, const char *name)
   int err_pdes[2];
   int pid;
 
+  if (*name == '|')
+    {
+      name++;
+      name = skip_spaces (name);
+    }
+
   if (gdb_socketpair_cloexec (AF_UNIX, SOCK_STREAM, 0, pdes) < 0)
     return -1;
   if (gdb_socketpair_cloexec (AF_UNIX, SOCK_STREAM, 0, err_pdes) < 0)