Ticket #8776: FixApostropheBug.patch

File FixApostropheBug.patch, 923 bytes (added by x-ist, 12 years ago)
  • src/apps/text_search/Grepper.cpp

    From 11e4b5d760373aaad28abb4558db5a830d1a7d0b Mon Sep 17 00:00:00 2001
    From: x-ist
    Date: Thu, 2 Aug 2012 19:35:45 +0000
    Subject: [PATCH] Since the search pattern is wrapped in double quotes for
     grep, the symbol ' (apostrophe) must not be escaped. Fixes
     #8776.
    
    ---
     src/apps/text_search/Grepper.cpp |    3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/src/apps/text_search/Grepper.cpp b/src/apps/text_search/Grepper.cpp
    index 053dcbb..a20103e 100644
    a b Grepper::_SetPattern(const char* src)  
    302302            ||  (c == '?')  || (c == '*')
    303303            ||  (c == '+')  || (c == '-')
    304304            ||  (c == ':')  || (c == '^')
    305             ||  (c == '\'') || (c == '"')
    306             ||  (c == '`')) {
     305            ||  (c == '"')  || (c == '`')) {
    307306            *dstPtr++ = '\\';
    308307        } else if ((c == '\\') || (c == '$')) {
    309308            // Some characters need to be escaped