Normalize includes to use common/
[deliverable/binutils-gdb.git] / gdb / mi / mi-cmd-env.c
index f24f387b14fcaff4d33747be60c9bab85bae867b..fcc49b9eb36117e8f9836d5e859b7be17fc61e6a 100644 (file)
@@ -1,5 +1,5 @@
 /* MI Command Set - environment commands.
-   Copyright (C) 2002-2017 Free Software Foundation, Inc.
+   Copyright (C) 2002-2019 Free Software Foundation, Inc.
 
    Contributed by Red Hat Inc.
 
 #include "mi-getopt.h"
 #include "symtab.h"
 #include "target.h"
-#include "environ.h"
+#include "common/environ.h"
 #include "command.h"
 #include "ui-out.h"
 #include "top.h"
 #include <sys/stat.h>
-
-static void env_mod_path (char *dirname, char **which_path);
-
-extern void _initialize_mi_cmd_env (void);
+#include "source.h"
 
 static const char path_var_name[] = "PATH";
 static char *orig_path = NULL;
@@ -76,11 +73,12 @@ mi_cmd_env_pwd (const char *command, char **argv, int argc)
      
   /* Otherwise the mi level is 2 or higher.  */
 
-  if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)))
+  gdb::unique_xmalloc_ptr<char> cwd (getcwd (NULL, 0));
+  if (cwd == NULL)
     error (_("-environment-pwd: error finding name of working directory: %s"),
            safe_strerror (errno));
-    
-  uiout->field_string ("cwd", gdb_dirbuf);
+
+  uiout->field_string ("cwd", cwd.get ());
 }
 
 /* Change working directory.  */
@@ -95,7 +93,7 @@ mi_cmd_env_cd (const char *command, char **argv, int argc)
 }
 
 static void
-env_mod_path (char *dirname, char **which_path)
+env_mod_path (const char *dirname, char **which_path)
 {
   if (dirname == 0 || dirname[0] == '\0')
     return;
This page took 0.025131 seconds and 4 git commands to generate.