[Dnsmasq-discuss] [PATCH] src/inotify.c: s/in->len/strlen(in->name)/

Andy Hawkins andy at gently.org.uk
Mon Feb 12 15:59:18 GMT 2018


Hi,

For clarity, I didn't write the below, Geert Stappers did, trying to be
helpful.

I'll try to generate a correctly formatted patch, and send it through
myself.

Thanks

Andy

In article <1518436327-26699-1-git-send-email-andy at gently.org.uk>,
           Andy Hawkins<andy at gently.org.uk> wrote:
> Ignoring backup files from editor didn't work for me.
>
> After modification of src/inotify.c where twice an
>     in->len
> was replaced by
>     strlen(in->name)
> it did work as expected.
> ---
>  src/inotify.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/inotify.c b/src/inotify.c
> index eda1d56..45c730a 100644
> --- a/src/inotify.c
> +++ b/src/inotify.c
> @@ -235,8 +235,8 @@ int inotify_check(time_t now)
>  
>  	  /* ignore emacs backups and dotfiles */
>  	  if (in->len == 0 || 
> -	      in->name[in->len - 1] == '~' ||
> -	      (in->name[0] == '#' && in->name[in->len - 1] == '#') ||
> +	      in->name[strlen(in->name) - 1] == '~' ||
> +	      (in->name[0] == '#' && in->name[strlen(in->name) - 1] == '#') ||
>  	      in->name[0] == '.')
>  	    continue;
>  	  




More information about the Dnsmasq-discuss mailing list