]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdbsupport/gdb_tilde_expand.cc
Move unrelocated_addr to common-types.h
[thirdparty/binutils-gdb.git] / gdbsupport / gdb_tilde_expand.cc
index e3f9308a14f0837e5a1ee727ab0d3a5da00be4ee..6107121075a705aae443afa2b67fa74b6e32b848 100644 (file)
@@ -1,6 +1,6 @@
 /* Perform tilde expansion on paths for GDB and gdbserver.
 
-   Copyright (C) 2017-2022 Free Software Foundation, Inc.
+   Copyright (C) 2017-2023 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -90,10 +90,8 @@ gdb_tilde_expand (const char *dir)
   /* Look for the first dir separator (if any) and split d around it.  */
   const auto first_sep
     = std::find_if (d.cbegin (), d.cend(),
-                    [] (const char c) -> bool
-                    {
-                      return IS_DIR_SEPARATOR (c);
-                    });
+                   [] (const char c) -> bool
+                     { return IS_DIR_SEPARATOR (c); });
   const std::string to_expand (d.cbegin (), first_sep);
   const std::string remainder (first_sep, d.cend ());
 
@@ -102,12 +100,3 @@ gdb_tilde_expand (const char *dir)
   gdb_assert (glob.pathc () == 1);
   return std::string (glob.pathv ()[0]) + remainder;
 }
-
-/* See gdbsupport/gdb_tilde_expand.h.  */
-
-gdb::unique_xmalloc_ptr<char>
-gdb_tilde_expand_up (const char *dir)
-{
-  const std::string expanded = gdb_tilde_expand (dir);
-  return make_unique_xstrdup (expanded.c_str ());
-}