[RFA,45/67] Constify cd_command

Message ID 20170921051023.19023-46-tom@tromey.com
State New, archived
Headers

Commit Message

Tom Tromey Sept. 21, 2017, 5:10 a.m. UTC
  ChangeLog
2017-09-20  Tom Tromey  <tom@tromey.com>

	* cli/cli-cmds.h (cd_command): Constify.
	* cli/cli-cmds.c (cd_command): Constify.
---
 gdb/ChangeLog      | 5 +++++
 gdb/cli/cli-cmds.c | 2 +-
 gdb/cli/cli-cmds.h | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)
  

Comments

Sergio Durigan Junior Sept. 21, 2017, 12:47 p.m. UTC | #1
On Thursday, September 21 2017, Tom Tromey wrote:

> ChangeLog
> 2017-09-20  Tom Tromey  <tom@tromey.com>
>
> 	* cli/cli-cmds.h (cd_command): Constify.
> 	* cli/cli-cmds.c (cd_command): Constify.

I've been meaning to do that.  This is OK by me.  Thanks,

> ---
>  gdb/ChangeLog      | 5 +++++
>  gdb/cli/cli-cmds.c | 2 +-
>  gdb/cli/cli-cmds.h | 2 +-
>  3 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
> index 4cc9fa6..d87722f 100644
> --- a/gdb/cli/cli-cmds.c
> +++ b/gdb/cli/cli-cmds.c
> @@ -392,7 +392,7 @@ pwd_command (char *args, int from_tty)
>  }
>  
>  void
> -cd_command (char *dir, int from_tty)
> +cd_command (const char *dir, int from_tty)
>  {
>    int len;
>    /* Found something other than leading repetitions of "/..".  */
> diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h
> index 1122a97..34d19f5 100644
> --- a/gdb/cli/cli-cmds.h
> +++ b/gdb/cli/cli-cmds.h
> @@ -110,7 +110,7 @@ int is_complete_command (struct cmd_list_element *cmd);
>  
>  /* Exported to gdb/main.c */
>  
> -extern void cd_command (char *, int);
> +extern void cd_command (const char *, int);
>  
>  /* Exported to gdb/top.c and gdb/main.c */
>  
> -- 
> 2.9.4
  

Patch

diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 4cc9fa6..d87722f 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -392,7 +392,7 @@  pwd_command (char *args, int from_tty)
 }
 
 void
-cd_command (char *dir, int from_tty)
+cd_command (const char *dir, int from_tty)
 {
   int len;
   /* Found something other than leading repetitions of "/..".  */
diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h
index 1122a97..34d19f5 100644
--- a/gdb/cli/cli-cmds.h
+++ b/gdb/cli/cli-cmds.h
@@ -110,7 +110,7 @@  int is_complete_command (struct cmd_list_element *cmd);
 
 /* Exported to gdb/main.c */
 
-extern void cd_command (char *, int);
+extern void cd_command (const char *, int);
 
 /* Exported to gdb/top.c and gdb/main.c */