[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 38/150: fnmatch: do not match the empty string with
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 38/150: fnmatch: do not match the empty string with a character set |
Date: |
Fri, 30 Mar 2018 16:48:12 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 19abad095caafb2279f8aeb5d39cd038dcece938
Author: Patrick Monnerat <address@hidden>
AuthorDate: Mon Jan 29 13:01:43 2018 +0100
fnmatch: do not match the empty string with a character set
---
lib/curl_fnmatch.c | 6 +++---
tests/unit/unit1307.c | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/curl_fnmatch.c b/lib/curl_fnmatch.c
index f33bba1f1..5b6d28c06 100644
--- a/lib/curl_fnmatch.c
+++ b/lib/curl_fnmatch.c
@@ -352,6 +352,8 @@ static int loop(const unsigned char *pattern, const
unsigned char *string,
unsigned char *pp = p + 1; /* cannot handle with pointer to register */
if(setcharset(&pp, charset)) {
int found = FALSE;
+ if(!*s)
+ return CURL_FNMATCH_NOMATCH;
if(charset[(unsigned int)*s])
found = TRUE;
else if(charset[CURLFNM_ALNUM])
@@ -380,9 +382,7 @@ static int loop(const unsigned char *pattern, const
unsigned char *string,
if(found) {
p = pp + 1;
- if(*s)
- /* don't advance if we're matching on an empty string */
- s++;
+ s++;
memset(charset, 0, CURLFNM_CHSET_SIZE);
}
else
diff --git a/tests/unit/unit1307.c b/tests/unit/unit1307.c
index 266eed392..eff5edebc 100644
--- a/tests/unit/unit1307.c
+++ b/tests/unit/unit1307.c
@@ -97,8 +97,8 @@ static const struct testcase tests[] = {
{ "*[^a].t?t", "a.txt", NOMATCH },
{ "*[^a].t?t", "ba.txt", NOMATCH },
{ "*[^a].t?t", "ab.txt", MATCH },
- { "*[^a]", "", MATCH },
- { "[!ÿ]", "", MATCH },
+ { "*[^a]", "", NOMATCH },
+ { "[!ÿ]", "", NOMATCH },
{ "[!?*[]", "?", NOMATCH },
{ "[!!]", "!", NOMATCH },
{ "[!!]", "x", MATCH },
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 12/150: configure: fix the check for unsigned time_t, (continued)
- [GNUnet-SVN] [gnurl] 12/150: configure: fix the check for unsigned time_t, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 15/150: lib544: sync ascii code data with textual data, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 27/150: curl_easy_reset: clear digest auth state, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 13/150: darwinssl: Don't import client certificates into Keychain on macOS, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 14/150: GSKit: restore pinnedpubkey functionality, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 07/150: bump: towards 7.58.1, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 16/150: lib517: make variable static to avoid compiler warning, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 17/150: lib555: drop text conversion and encode data as ascii codes, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 29/150: curl/curl.h: fix comment typo for CURLOPT_DNS_LOCAL_IP6, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 10/150: openssl: fix pinned public key build error in FIPS mode, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 38/150: fnmatch: do not match the empty string with a character set,
gnunet <=
- [GNUnet-SVN] [gnurl] 18/150: docs: fix typos in man pages, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 19/150: KNOWN_BUGS: DICT responses show the underlying protocol, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 20/150: TODO: UTF-8 filenames in Content-Disposition, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 22/150: build: open VC15 projects with VS 2017, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 24/150: configure: set PATH_SEPARATOR to colon for PATH w/o separator, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 26/150: winbuild: make linker generate proper PDB, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 21/150: RELEASE-NOTES: synced with 094647fca, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 45/150: getdate: return -1 for out of range, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 30/150: curlver: next release will be 7.59.0, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 40/150: fnmatch: pattern syntax can no longer fail, gnunet, 2018/03/30