[hackers] [sbase] grep: Change match any pattern to "^" || sin

From: <git_AT_suckless.org>
Date: Wed, 20 Jan 2016 18:27:39 +0100 (CET)

commit 0d955d3f23f322d3b2b2ffda8287f548f88c3e19
Author: sin <sin_AT_2f30.org>
AuthorDate: Wed Jan 20 17:26:47 2016 +0000
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Jan 20 17:27:35 2016 +0000

    grep: Change match any pattern to "^"

diff --git a/grep.c b/grep.c
index 8744fcd..64ffbe2 100644
--- a/grep.c
+++ b/grep.c
_AT_@ -50,7 +50,7 @@ addpattern(const char *pattern, size_t patlen)
         /* a null BRE/ERE matches every line */
         if (!Fflag)
                 if (pattern[0] == '\0')
- pattern = ".";
+ pattern = "^";
 
         if (!Fflag && xflag) {
                 tmp = enmalloc(Error, patlen + 3);
Received on Wed Jan 20 2016 - 18:27:39 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 20 2016 - 18:36:14 CET