]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rust: Use 'lbasename()' consistently.
authorIain Sandoe <iain@sandoe.co.uk>
Mon, 24 Mar 2025 08:33:53 +0000 (08:33 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Wed, 26 Mar 2025 06:35:52 +0000 (06:35 +0000)
The amends the remaining case in the rust code to use the libiberty
lbasename() instead of the (potentially variably-behaved) system
'basename()'.

gcc/rust/ChangeLog:

* metadata/rust-export-metadata.cc
(PublicInterface::write_to_path): Use 'lbasename()' instead of
'basename()'.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/rust/metadata/rust-export-metadata.cc

index 79c5f30d7554e926810552b237c69a819b4e5f25..771bec6e63785f09bee5922d339066c3b9c3bb0f 100644 (file)
@@ -234,7 +234,7 @@ PublicInterface::write_to_path (const std::string &path) const
 {
   // validate path contains correct extension
   const std::string expected_file_name = expected_metadata_filename ();
-  const char *path_base_name = basename (path.c_str ());
+  const char *path_base_name = lbasename (path.c_str ());
   if (strcmp (path_base_name, expected_file_name.c_str ()) != 0)
     {
       rust_error_at (UNDEF_LOCATION,