Hi, Tim Rühsen <tim.rueh...@gmx.de> writes:
> I replaced some hand-written string code by standard library functions. > In any case these functions may be found in gnulib as well. > From d540fd5dbd3644936a8ad1a384516abba10de268 Mon Sep 17 00:00:00 2001 > From: Tim Ruehsen <tim.rueh...@gmx.de> > Date: Thu, 9 May 2013 19:53:36 +0200 > Subject: [PATCH 1/3] src/utils.c cleanup thanks for the patch, I amended these trivial changes and applied it: > src/ChangeLog | 6 ++++++ 2013-05-09 Tim Ruehsen <tim.rueh...@gmx.de> * utils.c (acceptable): use standard string functions instead of self-written code. (match_tail): Likewise. (suffix): Likewise. (has_wildcards_p): Likewise. (test_subdir_p): Fix some warnings. (test_dir_matches_p): Likewise. > src/utils.c | 66 > ++++++++++++++++++++------------------------------------- > + if ((p = strrchr(s, '/'))) + if ((p = strrchr (s, '/'))) > + int pos = strlen (string) - strlen(tail); + int pos = strlen (string) - strlen (tail); > + return false; /* tail is longer than string */ + return false; /* tail is longer than string. */ > + if ((p = strrchr(str, '.')) && !strchr(p + 1, '/')) + if ((p = strrchr (str, '.')) && !strchr (p + 1, '/')) > + return p + 1; + return p + 1; > + return !!strpbrk(s, "*?[]"); + return !!strpbrk (s, "*?[]"); -- Giuseppe