summaryrefslogtreecommitdiff
path: root/app-portage/conf-update/files/conf-update-1.0.3-fno-common.patch
blob: 04c72687dde5054a62e48ef37f5893b63ad4f676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--- a/config.c
+++ b/config.c
@@ -1,5 +1,7 @@
 #include "conf-update.h"
 
+struct configuration config;
+
 bool get_boolean(GKeyFile *conffile, const char *key, bool default_value) {
 	GError *error = NULL;
 	bool value, invalid_value, key_not_found;
@@ -26,7 +28,6 @@ char *get_string(GKeyFile *conffile, const char *key, char *default_value) {
 }
 
 void read_config() {
-	extern struct configuration config;
 	GKeyFile *conffile;
 	
 	// set reasonable defaults
--- a/config.h
+++ b/config.h
@@ -8,6 +8,8 @@ struct configuration {
 	char *diff_tool;
 	char *merge_tool;
 	char *edit_tool;
-} config;
+};
+
+extern struct configuration config;
 
 void read_config();
--- a/core.c
+++ b/core.c
@@ -1,5 +1,7 @@
 #include "conf-update.h"
 
+extern struct configuration config;
+
 char *get_real_filename(const char *update) {
 	char *file = (char *)calloc(strlen(update) + 1 - strlen("._cfg????_"), sizeof(char));
 	strncpy(file, update, strrchr(update, '/') - update + 1);
@@ -73,7 +75,6 @@ void merge(char *update, char **index) {
 }
 
 int show_diff(char *update) {
-	extern struct configuration config;
 	char *realfile = get_real_filename(update);
 	char *esc_realfile = g_shell_quote(realfile);
 	char *esc_update = g_shell_quote(update);
@@ -98,7 +99,6 @@ int show_diff(char *update) {
 }
 
 int edit_update(char *update) {
-	extern struct configuration config;
 	char *esc_update = g_shell_quote(update);
 	char *cmd = calloc(strlen(config.edit_tool) + strlen("  ") + strlen(esc_update), sizeof(char));
 	int ret;
@@ -116,7 +116,6 @@ int edit_update(char *update) {
 char **merge_interactively(char *update, char **index) {
 	// customized versions are ._cfg????- with a minus instead of a underscore
 	// that way get_real_filename() works without modification
-	extern struct configuration config;
 	char *realfile = get_real_filename(update);
 	char *esc_realfile = g_shell_quote(realfile);
 	char *esc_update = g_shell_quote(update);