From: Volker Lendecke Date: Wed, 9 Nov 2022 09:15:31 +0000 (+0100) Subject: lib: Whitespace fixes X-Git-Tag: talloc-2.4.0~520 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7d4b8eaac71e7af334d313d215139ed9bcaa7f8;p=thirdparty%2Fsamba.git lib: Whitespace fixes Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/lib/util/ms_fnmatch.c b/lib/util/ms_fnmatch.c index e43d4e0a3be..90aab13ec90 100644 --- a/lib/util/ms_fnmatch.c +++ b/lib/util/ms_fnmatch.c @@ -1,4 +1,4 @@ -/* +/* Unix SMB/CIFS implementation. filename matching routine Copyright (C) Andrew Tridgell 1992-2004 @@ -7,21 +7,21 @@ it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . */ /* This module was originally based on fnmatch.c copyright by the Free Software Foundation. It bears little (if any) resemblence to that code now -*/ +*/ /** * @file @@ -59,7 +59,7 @@ struct max_n { an optimisation only. The ldot pointer is NULL if the string does not contain a '.', otherwise it points at the last dot in 'n'. */ -static int ms_fnmatch_core(const char *p, const char *n, +static int ms_fnmatch_core(const char *p, const char *n, struct max_n *max_n, const char *ldot, bool is_case_sensitive) { @@ -168,11 +168,11 @@ static int ms_fnmatch_core(const char *p, const char *n, break; } } - + if (! *n) { return 0; } - + return -1; } @@ -205,12 +205,12 @@ int ms_fnmatch_protocol(const char *pattern, const char *string, int protocol, for (i=0;p[i];i++) { if (p[i] == '?') { p[i] = '>'; - } else if (p[i] == '.' && - (p[i+1] == '?' || + } else if (p[i] == '.' && + (p[i+1] == '?' || p[i+1] == '*' || p[i+1] == 0)) { p[i] = '"'; - } else if (p[i] == '*' && + } else if (p[i] == '*' && p[i+1] == '.') { p[i] = '<'; }