[Geany-devel] [PATCH 15/19] Do not insert --include= when the search pattern entry is empty

Nick Treleaven nick.treleaven at xxxxx
Tue Aug 24 12:19:41 UTC 2010


On Thu,  5 Aug 2010 01:59:49 +0200
Jiří Techet <techet at gmail.com> wrote:

> --- a/src/search.c
> +++ b/src/search.c
> @@ -1329,7 +1329,8 @@ static GString *get_grep_options(void)
>  		g_strstrip(settings.fif_files);
>  		tmp = g_string_new(settings.fif_files);
>  		do {} while (utils_string_replace_all(tmp, "  ", " "));
> -		g_string_prepend_c(tmp, ' ');
> +		if (tmp->len != 0)
> +			g_string_prepend_c(tmp, ' ');
>  		utils_string_replace_all(tmp, " ", " --include=");
>  		g_string_append(gstr, tmp->str);
>  		g_string_free(tmp, TRUE);

I implemented this differently to not process the block if the pattern
is empty, which seems clearer.

Regards,
Nick



More information about the Devel mailing list