PERFORCE change 155952 for review

Gabor Kovesdan gabor at FreeBSD.org
Sun Jan 11 04:09:51 PST 2009


http://perforce.freebsd.org/chv.cgi?CH=155952

Change 155952 by gabor at gabor_server on 2009/01/11 12:09:16

	- Remove this weird boundary match part. Boundary matching is handled
	  in util.c.

Affected files ...

.. //depot/projects/soc2008/gabor_textproc/grep/grep.c#77 edit

Differences ...

==== //depot/projects/soc2008/gabor_textproc/grep/grep.c#77 (text+ko) ====

@@ -237,27 +237,9 @@
 	if (len > 0 && pat[len - 1] == '\n')
 		--len;
 	/* pat may not be NUL-terminated */
-	if (wflag && !(grepbehave == GREP_FIXED)) {
-		int bol = 0, eol = 0, extra;
-		if (pat[0] == '^')
-			bol = 1;
-		if (len > 0 && pat[len - 1] == '$')
-			eol = 1;
-		extra = (grepbehave == GREP_EXTENDED) ? 2 : 4;
-		pattern[patterns] = grep_malloc(len + 15 + extra);
-		snprintf(pattern[patterns], len + 15 + extra,
-		   "%s[[:<:]]%s%.*s%s[[:>:]]%s",
-		    bol ? "^" : "",
-		    (grepbehave == GREP_EXTENDED) ? "(" : "\\(",
-		    (int)len - bol - eol, pat + bol,
-		    (grepbehave == GREP_EXTENDED) ? ")" : "\\)",
-		    eol ? "$" : "");
-		len += 14 + extra;
-	} else {
-		pattern[patterns] = grep_malloc(len + 1);
-		memcpy(pattern[patterns], pat, len);
-		pattern[patterns][len] = '\0';
-	}
+	pattern[patterns] = grep_malloc(len + 1);
+	memcpy(pattern[patterns], pat, len);
+	pattern[patterns][len] = '\0';
 	++patterns;
 }
 


More information about the p4-projects mailing list