-/* $OpenBSD: cmd.c,v 1.139 2017/05/30 21:44:59 nicm Exp $ */
+/* $OpenBSD: cmd.c,v 1.140 2018/08/02 18:35:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
NULL
};
+void
+cmd_log_argv(int argc, char **argv, const char *prefix)
+{
+ int i;
+
+ for (i = 0; i < argc; i++)
+ log_debug("%s: argv[%d]=%s", prefix, i, argv[i]);
+}
+
int
cmd_pack_argv(int argc, char **argv, char *buf, size_t len)
{
if (argc == 0)
return (0);
+ cmd_log_argv(argc, argv, __func__);
*buf = '\0';
for (i = 0; i < argc; i++) {
arglen = strlen(buf) + 1;
(*argv)[i] = xstrdup(buf);
+
buf += arglen;
len -= arglen;
}
+ cmd_log_argv(argc, *argv, __func__);
return (0);
}
xasprintf(cause, "unknown command: %s", name);
return (NULL);
}
+ cmd_log_argv(argc, argv, entry->name);
args = args_parse(entry->args.template, argc, argv);
if (args == NULL)
-/* $OpenBSD: tmux.h,v 1.835 2018/08/02 11:56:12 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.836 2018/08/02 18:35:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
int cmd_find_from_nothing(struct cmd_find_state *, int);
/* cmd.c */
+void cmd_log_argv(int, char **, const char *);
int cmd_pack_argv(int, char **, char *, size_t);
int cmd_unpack_argv(char *, size_t, int, char ***);
char **cmd_copy_argv(int, char **);
-/* $OpenBSD: window.c,v 1.210 2018/05/24 09:42:49 nicm Exp $ */
+/* $OpenBSD: window.c,v 1.211 2018/08/02 18:35:21 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
log_debug("%s: shell=%s", __func__, wp->shell);
log_debug("%s: cmd=%s", __func__, cmd);
log_debug("%s: cwd=%s", __func__, cwd);
- for (i = 0; i < wp->argc; i++)
- log_debug("%s: argv[%d]=%s", __func__, i, wp->argv[i]);
+ cmd_log_argv(wp->argc, wp->argv, __func__);
environ_log(env, "%s: environment ", __func__);
memset(&ws, 0, sizeof ws);