summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9a66631)
raw | patch | inline | side by side (parent: 9a66631)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 28 May 2006 02:19:46 +0000 (04:19 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Sun, 28 May 2006 02:21:40 +0000 (04:21 +0200) |
tig.c | patch | blob | history |
index 055ad117ce5f83708f7eda93da70272b9e9b7751..6a72f7a02cb4525ab356c9e9b99c7e1c38c81e85 100644 (file)
--- a/tig.c
+++ b/tig.c
static void die(const char *err, ...);
static void report(const char *msg, ...);
-static int read_properties(const char *cmd, int separator, int (*read)(char *, int, char *, int));
+static int read_properties(FILE *pipe, int separator, int (*read)(char *, int, char *, int));
static void set_nonblocking_input(bool loading);
static size_t utf8_length(const char *string, size_t max_width, int *coloffset, int *trimmed);
const char *cmd_env = getenv("TIG_LS_REMOTE");
const char *cmd = cmd_env && *cmd_env ? cmd_env : TIG_LS_REMOTE;
- return read_properties(cmd, '\t', read_ref);
+ return read_properties(popen(cmd, "r"), '\t', read_ref);
}
static int
static int
load_config(void)
{
- return read_properties("git repo-config --list", '=',
- read_config_option);
+ return read_properties(popen("git repo-config --list", "r"),
+ '=', read_config_option);
}
static int
-read_properties(const char *cmd, int separator,
+read_properties(FILE *pipe, int separator,
int (*read_property)(char *, int, char *, int))
{
- FILE *pipe = popen(cmd, "r");
char buffer[BUFSIZ];
char *name;
int state = OK;