summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-07-20 09:45:37 +0100
committerPeter Stephenson <pws@zsh.org>2016-07-20 09:45:37 +0100
commit317494e9985590bbf975f934c0f1425596744939 (patch)
treed6faf739f85fcd65f2f577d82961ce6f3e98eed0
parent6e966f691d588932cde025083fa91575f661119a (diff)
downloadzsh-317494e9985590bbf975f934c0f1425596744939.tar.gz
zsh-317494e9985590bbf975f934c0f1425596744939.tar.xz
zsh-317494e9985590bbf975f934c0f1425596744939.zip
38853: use strchr()
-rw-r--r--ChangeLog4
-rw-r--r--Src/glob.c8
2 files changed, 5 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index bdcfd6f6b..8582acb0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-07-20  Peter Stephenson  <p.stephenson@samsung.com>
+
+	* 38853: Src/glob.c: use strchr().
+
 2016-07-20  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* users/21777: Doc/Zsh/expn.yo: Clarify documentation of the
diff --git a/Src/glob.c b/Src/glob.c
index 146b4dbbc..850405fd4 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -1922,13 +1922,7 @@ zglob(LinkList list, LinkNode np, int nountok)
 	 */
 	for (gmptr = matchbuf; gmptr < matchptr; gmptr++)
 	{
-	    char *nptr;
-	    for (nptr = gmptr->name; *nptr; nptr++)
-	    {
-		if (*nptr == Meta)
-		    break;
-	    }
-	    if (*nptr == Meta)
+	    if (strchr(gmptr->name, Meta))
 	    {
 		int dummy;
 		gmptr->uname = dupstring(gmptr->name);