From 117e270f1ff02b56302627331e8d97645012a2a0 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 2 Jun 2010 16:29:12 -0400 Subject: [PATCH] Make argv_copy always allocate its members --- tig.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tig.c b/tig.c index 3121a3a..f364930 100644 --- a/tig.c +++ b/tig.c @@ -682,12 +682,12 @@ argv_free(const char *argv[]) } static bool -argv_copy(const char *dst[], const char *src[], bool allocate) +argv_copy(const char *dst[], const char *src[]) { int argc; for (argc = 0; src[argc]; argc++) - if (!(dst[argc] = allocate ? strdup(src[argc]) : src[argc])) + if (!(dst[argc] = strdup(src[argc]))) return FALSE; return TRUE; } @@ -1714,7 +1714,7 @@ add_run_request(enum keymap keymap, int key, int argc, const char **argv) req->key = key; req->argv[0] = NULL; - if (!argv_copy(req->argv, argv, TRUE)) + if (!argv_copy(req->argv, argv)) return REQ_NONE; return REQ_NONE + ++run_requests; -- 2.30.2