summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a7dbd41)
raw | patch | inline | side by side (parent: a7dbd41)
author | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 11 Jun 2010 00:02:39 +0000 (20:02 -0400) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Fri, 11 Jun 2010 00:02:39 +0000 (20:02 -0400) |
tig.c | patch | blob | history |
index e5612c197c7320b51ea0303284ab52718ca6d9eb..d7752a2f9131b75d4f7b9a58edad7e1bffdfff12 100644 (file)
--- a/tig.c
+++ b/tig.c
const char *home = getenv("HOME");
const char *tigrc_user = getenv("TIGRC_USER");
const char *tigrc_system = getenv("TIGRC_SYSTEM");
+ const char *tig_diff_opts = getenv("TIG_DIFF_OPTS");
char buf[SIZEOF_STR];
if (!tigrc_system)
* that conflict with keybindings. */
add_builtin_run_requests();
+ if (!opt_diff_args && tig_diff_opts && *tig_diff_opts) {
+ static const char *diff_opts[SIZEOF_ARG] = { NULL };
+ int argc = 0;
+
+ if (!string_format(buf, "%s", tig_diff_opts) ||
+ !argv_from_string(diff_opts, &argc, buf))
+ die("TIG_DIFF_OPTS contains too many arguments");
+ else if (!argv_copy(&opt_diff_args, diff_opts))
+ die("Failed to format TIG_DIFF_OPTS arguments");
+ }
+
return OK;
}