Line
Link Here
|
0 |
-- a/config.h |
0 |
++ b/config.h |
Lines 1-6
Link Here
|
1 |
#define CONF_UPDATE_CONFIG_FILE "/etc/conf-update/conf-update.conf" |
1 |
#define CONF_UPDATE_CONFIG_FILE "/etc/conf-update/conf-update.conf" |
2 |
|
2 |
|
3 |
struct configuration { |
3 |
extern struct configuration { |
4 |
bool automerge_trivial; |
4 |
bool automerge_trivial; |
5 |
bool automerge_unmodified; |
5 |
bool automerge_unmodified; |
6 |
bool check_actions; |
6 |
bool check_actions; |
7 |
-- a/helpers.c |
7 |
++ b/helpers.c |
Lines 184-190
Link Here
|
184 |
} |
184 |
} |
185 |
} |
185 |
} |
186 |
void sanity_checks() { |
186 |
void sanity_checks() { |
187 |
extern struct configuration config; |
|
|
188 |
unsigned int i; |
187 |
unsigned int i; |
189 |
FILE *pipe; |
188 |
FILE *pipe; |
190 |
char *cmd = NULL; |
189 |
char *cmd = NULL; |
191 |
-- a/core.c |
190 |
++ b/core.c |
Lines 73-79
Link Here
|
73 |
} |
73 |
} |
74 |
|
74 |
|
75 |
int show_diff(char *update) { |
75 |
int show_diff(char *update) { |
76 |
extern struct configuration config; |
|
|
77 |
char *realfile = get_real_filename(update); |
76 |
char *realfile = get_real_filename(update); |
78 |
char *esc_realfile = g_shell_quote(realfile); |
77 |
char *esc_realfile = g_shell_quote(realfile); |
79 |
char *esc_update = g_shell_quote(update); |
78 |
char *esc_update = g_shell_quote(update); |
Lines 98-104
Link Here
|
98 |
} |
97 |
} |
99 |
|
98 |
|
100 |
int edit_update(char *update) { |
99 |
int edit_update(char *update) { |
101 |
extern struct configuration config; |
|
|
102 |
char *esc_update = g_shell_quote(update); |
100 |
char *esc_update = g_shell_quote(update); |
103 |
char *cmd = calloc(strlen(config.edit_tool) + strlen(" ") + strlen(esc_update), sizeof(char)); |
101 |
char *cmd = calloc(strlen(config.edit_tool) + strlen(" ") + strlen(esc_update), sizeof(char)); |
104 |
int ret; |
102 |
int ret; |
Lines 116-122
Link Here
|
116 |
char **merge_interactively(char *update, char **index) { |
114 |
char **merge_interactively(char *update, char **index) { |
117 |
// customized versions are ._cfg????- with a minus instead of a underscore |
115 |
// customized versions are ._cfg????- with a minus instead of a underscore |
118 |
// that way get_real_filename() works without modification |
116 |
// that way get_real_filename() works without modification |
119 |
extern struct configuration config; |
|
|
120 |
char *realfile = get_real_filename(update); |
117 |
char *realfile = get_real_filename(update); |
121 |
char *esc_realfile = g_shell_quote(realfile); |
118 |
char *esc_realfile = g_shell_quote(realfile); |
122 |
char *esc_update = g_shell_quote(update); |
119 |
char *esc_update = g_shell_quote(update); |
123 |
-- a/config.c |
120 |
++ b/config.c |
Lines 1-5
Link Here
|
1 |
#include "conf-update.h" |
1 |
#include "conf-update.h" |
2 |
|
2 |
|
|
|
3 |
struct configuration config; |
4 |
|
3 |
bool get_boolean(GKeyFile *conffile, const char *key, bool default_value) { |
5 |
bool get_boolean(GKeyFile *conffile, const char *key, bool default_value) { |
4 |
GError *error = NULL; |
6 |
GError *error = NULL; |
5 |
bool value, invalid_value, key_not_found; |
7 |
bool value, invalid_value, key_not_found; |
Lines 26-32
Link Here
|
26 |
} |
28 |
} |
27 |
|
29 |
|
28 |
void read_config() { |
30 |
void read_config() { |
29 |
extern struct configuration config; |
|
|
30 |
GKeyFile *conffile; |
31 |
GKeyFile *conffile; |
31 |
|
32 |
|
32 |
// set reasonable defaults |
33 |
// set reasonable defaults |