RE: blank lines added to /etc/hosts [PATCH]



On Tue, 2008-11-04 at 17:04 -0500, Miner, Jonathan W (US SSA) wrote:
> I think this will fix my issue... only append the newline if we're not parsing the last line of the file.
> 
> --- src/NetworkManagerPolicy.c.orig	2008-11-03 09:33:08.000000000 -0500
> +++ src/NetworkManagerPolicy.c	2008-11-04 17:02:39.000000000 -0500
> @@ -306,7 +306,8 @@
>  
>  		if (add_line) {
>  			g_string_append (new_contents, *line);
> -			g_string_append_c (new_contents, '\n');
> +                        if (*(line+1)) /* if not the last line */
> +				g_string_append_c (new_contents, '\n');
>  		}
>  	}

Committed, thanks!

dan




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