Package: grep
Tags: patch

`]' should also take into special characters in fgrep_to_grep_pattern.

Norihiro
>From 47e891d0c66259c506db466f830bdf963037999a Mon Sep 17 00:00:00 2001
From: Norihiro Tanaka <[email protected]>
Date: Mon, 24 Mar 2014 22:58:21 +0900
Subject: [PATCH] grep: addition of ]' to special characters

* src/grep.c (fgrep_to_grep_pattern): Add `]' to special characters.
---
 src/grep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/grep.c b/src/grep.c
index a1bccdb..86d7dca 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -1931,7 +1931,7 @@ fgrep_to_grep_pattern (size_t len, char const *keys,
           /* Fall through.  */
         case 1:
           *p = '\\';
-          p += strchr ("$*.[\\^", *keys) != NULL;
+          p += strchr ("$*.[]\\^", *keys) != NULL;
           /* Fall through.  */
         case 0:
           *p++ = *keys;
-- 
1.9.1

Reply via email to