Guard against 'current_directory == NULL' on gdb_abspath (PR gdb/23613)
[deliverable/binutils-gdb.git] / gdb / corelow.c
index bdbfae372d74f187d1ebde7f03ab823e7c741b7d..6c1e47a555674ddb20002a9fb40d434b6d7799f7 100644 (file)
@@ -44,6 +44,7 @@
 #include "completer.h"
 #include "gdbsupport/filestuff.h"
 #include "build-id.h"
+#include "gdbsupport/pathstuff.h"
 
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0
@@ -395,8 +396,7 @@ core_target_open (const char *arg, int from_tty)
 
   gdb::unique_xmalloc_ptr<char> filename (tilde_expand (arg));
   if (!IS_ABSOLUTE_PATH (filename.get ()))
-    filename.reset (concat (current_directory, "/",
-                           filename.get (), (char *) NULL));
+    filename = gdb_abspath (filename.get ());
 
   flags = O_BINARY | O_LARGEFILE;
   if (write_files)
This page took 0.023999 seconds and 4 git commands to generate.