2008-11-05 Dan Williams <dcbw@redhat.com>
authorDan Williams <dcbw@redhat.com>
Wed, 5 Nov 2008 17:43:45 +0000 (17:43 +0000)
committerDan Williams <dcbw@redhat.com>
Wed, 5 Nov 2008 17:43:45 +0000 (17:43 +0000)
* src/NetworkManagerPolicy.c
- (update_etc_hosts): only add newline if not the last line of the file
(Jonathan Miner)

git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4268 4912f4e0-d625-0410-9fb7-b9a5a253dbdc

ChangeLog
src/NetworkManagerPolicy.c

index 0c55b7e..e7ddf10 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-05  Dan Williams  <dcbw@redhat.com>
+
+       * src/NetworkManagerPolicy.c
+               - (update_etc_hosts): only add newline if not the last line of the file
+                       (Jonathan Miner)
+
 2008-11-05  Dan Williams  <dcbw@redhat.com>
 
        * src/dhcp-manager/nm-dhcp-dhclient.c
index 45403a2..de85d4c 100644 (file)
@@ -306,7 +306,9 @@ update_etc_hosts (const char *hostname)
 
                if (add_line) {
                        g_string_append (new_contents, *line);
-                       g_string_append_c (new_contents, '\n');
+                       /* Only append the new line if this isn't the last line in the file */
+                       if (*(line+1))
+                               g_string_append_c (new_contents, '\n');
                }
        }