The branch, master has been updated
via 255a4f8ce34c027a4e903ec795214f8280c1e17d (commit)
from e2b26d910c7614cceef20282ee6991b1468238fc (commit)
- Log -----------------------------------------------------------------
commit 255a4f8ce34c027a4e903ec795214f8280c1e17d
Author: Nicholas Marriott <[email protected]>
Commit: Nicholas Marriott <[email protected]>
load_cfg can actually use the same context now they are reference counted.
---
cfg.c | 23 ++++++++---------------
1 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/cfg.c b/cfg.c
index 5592229..0476222 100644
--- a/cfg.c
+++ b/cfg.c
@@ -73,14 +73,13 @@ cfg_add_cause(struct causelist *causes, const char *fmt,
...)
* causes. Note that causes must be initialised by the caller!
*/
enum cmd_retval
-load_cfg(const char *path, struct cmd_ctx *ctxin, struct causelist *causes)
+load_cfg(const char *path, struct cmd_ctx *ctx, struct causelist *causes)
{
FILE *f;
u_int n;
char *buf, *copy, *line, *cause;
size_t len, oldlen;
struct cmd_list *cmdlist;
- struct cmd_ctx *ctx;
enum cmd_retval retval;
if ((f = fopen(path, "rb")) == NULL) {
@@ -90,21 +89,15 @@ load_cfg(const char *path, struct cmd_ctx *ctxin, struct
causelist *causes)
cfg_references++;
- ctx = cmd_get_ctx();
- if (ctxin == NULL) {
- ctx->msgdata = NULL;
- ctx->curclient = NULL;
- ctx->cmdclient = NULL;
- } else {
- ctx->msgdata = ctxin->msgdata;
- ctx->curclient = ctxin->curclient;
- ctx->cmdclient = ctxin->cmdclient;
+ if (ctx != NULL)
+ cmd_ref_ctx(ctx);
+ else {
+ ctx = cmd_get_ctx();
+ ctx->error = cfg_error;
+ ctx->print = cfg_print;
+ ctx->info = cfg_print;
}
- ctx->error = cfg_error;
- ctx->print = cfg_print;
- ctx->info = cfg_print;
-
n = 0;
line = NULL;
retval = CMD_RETURN_NORMAL;
-----------------------------------------------------------------------
Summary of changes:
cfg.c | 23 ++++++++---------------
1 files changed, 8 insertions(+), 15 deletions(-)
hooks/post-receive
--
tmux
------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet,
is your hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials, tech docs,
whitepapers, evaluation guides, and opinion stories. Check out the most
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs