From 83324133055d9906d99f9709970d0e258ac87f79 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 20 Jan 2012 19:54:07 +0000 Subject: [PATCH] Add some const and fix a warning. --- cmd-new-window.c | 3 ++- cmd-split-window.c | 4 ++-- cmd.c | 4 ++-- tmux.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmd-new-window.c b/cmd-new-window.c index cdf45006..d858ee30 100644 --- a/cmd-new-window.c +++ b/cmd-new-window.c @@ -44,7 +44,8 @@ cmd_new_window_exec(struct cmd *self, struct cmd_ctx *ctx) struct args *args = self->args; struct session *s; struct winlink *wl; - char *cmd, *cwd, *cause; + const char *cmd, *cwd; + char *cause; int idx, last, detached; if (args_has(args, 'a')) { diff --git a/cmd-split-window.c b/cmd-split-window.c index 7184d964..05de0955 100644 --- a/cmd-split-window.c +++ b/cmd-split-window.c @@ -58,8 +58,8 @@ cmd_split_window_exec(struct cmd *self, struct cmd_ctx *ctx) struct window *w; struct window_pane *wp, *new_wp = NULL; struct environ env; - char *cmd, *cwd, *cause, *new_cause; - const char *shell; + const char *cmd, *cwd, *shell; + char *cause, *new_cause; u_int hlimit, paneidx; int size, percentage; enum layout_type type; diff --git a/cmd.c b/cmd.c index 65617a6c..f5d863d7 100644 --- a/cmd.c +++ b/cmd.c @@ -1215,10 +1215,10 @@ cmd_template_replace(char *template, const char *s, int idx) } /* Return the default path for a new pane. */ -char * +const char * cmd_get_default_path(struct cmd_ctx *ctx) { - char *cwd; + const char *cwd; struct session *s; struct window_pane *wp; struct environ_entry *envent; diff --git a/tmux.h b/tmux.h index dbb28c7e..effa15a1 100644 --- a/tmux.h +++ b/tmux.h @@ -1565,7 +1565,7 @@ int cmd_find_index( struct winlink *cmd_find_pane(struct cmd_ctx *, const char *, struct session **, struct window_pane **); char *cmd_template_replace(char *, const char *, int); -char *cmd_get_default_path(struct cmd_ctx *ctx); +const char *cmd_get_default_path(struct cmd_ctx *ctx); extern const struct cmd_entry *cmd_table[]; extern const struct cmd_entry cmd_attach_session_entry; extern const struct cmd_entry cmd_bind_key_entry;