NetworkManager r4268 - in trunk: . src



Author: dcbw
Date: Wed Nov  5 17:43:45 2008
New Revision: 4268
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=4268&view=rev

Log:
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)



Modified:
   trunk/ChangeLog
   trunk/src/NetworkManagerPolicy.c

Modified: trunk/src/NetworkManagerPolicy.c
==============================================================================
--- trunk/src/NetworkManagerPolicy.c	(original)
+++ trunk/src/NetworkManagerPolicy.c	Wed Nov  5 17:43:45 2008
@@ -306,7 +306,9 @@
 
 		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');
 		}
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]