blob: f96f580f198bb260c263ec566fd82a264192f874 (
about) (
plain) (
blame)
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
|
--- ./src/nm-hostname-manager.c.orig 2017-11-10 09:46:25.000000000 -0600
+++ ./src/nm-hostname-manager.c 2017-11-10 17:42:41.829996568 -0600
@@ -134,8 +134,7 @@
{
gs_free char *contents = NULL;
gs_strfreev char **all_lines = NULL;
- char *tmp;
- guint i, j = 0;
+ guint i = 0;
if (!g_file_get_contents (path, &contents, NULL, NULL))
return NULL;
@@ -145,17 +144,7 @@
g_strstrip (all_lines[i]);
if (all_lines[i][0] == '#' || all_lines[i][0] == '\0')
continue;
- tmp = &all_lines[i][0];
- /* We only want up to the first '.' -- the rest of the */
- /* fqdn is defined in /etc/hosts */
- while (tmp[j] != '\0') {
- if (tmp[j] == '.') {
- tmp[j] = '\0';
- break;
- }
- j++;
- }
- return g_shell_unquote (tmp, NULL);
+ return g_shell_unquote (&all_lines[i][0], NULL);
}
return NULL;
}
|