[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] [PATCH] bit cleanup in utils.c
From: |
Giuseppe Scrivano |
Subject: |
Re: [Bug-wget] [PATCH] bit cleanup in utils.c |
Date: |
Sun, 12 May 2013 21:41:20 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
Hi,
Tim Rühsen <address@hidden> 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 <address@hidden>
> 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 <address@hidden>
* 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