[hackers] [sbase] Use \< and \> instead of [[:<:]] and [[:>:]] || sin
commit 2ba7005dddc824d5967a78c596d89c214175eb6f
Author: sin <sin_AT_2f30.org>
Date: Thu Jan 22 17:37:52 2015 +0000
Use \< and \> instead of [[:<:]] and [[:>:]]
musl doesn't seem to support the latter, so use the older SVR4
word delimiters.
diff --git a/grep.c b/grep.c
index 7b932ca..6f6927e 100644
--- a/grep.c
+++ b/grep.c
_AT_@ -170,7 +170,7 @@ addpattern(const char *pattern)
pattern,
pattern[strlen(pattern) - 1] == '$' ? "" : "$");
} else if (!Fflag && wflag) {
- len = strlen(pattern) + 15 + (Eflag ? 2 : 4);
+ len = strlen(pattern) + 5 + (Eflag ? 2 : 4);
tmp = malloc(len);
if (!tmp)
enprintf(Error, "malloc:");
_AT_@ -181,7 +181,7 @@ addpattern(const char *pattern)
if (pattern[strlen(pattern) - 1] == '$')
eol = 1;
- snprintf(tmp, len, "%s[[:<:]]%s%.*s%s[[:>:]]%s",
+ snprintf(tmp, len, "%s\\<%s%.*s%s\\>%s",
bol ? "^" : "",
Eflag ? "(" : "\\(",
(int)strlen(pattern) - bol - eol, pattern + bol,
Received on Tue Mar 24 2015 - 23:53:13 CET
This archive was generated by hypermail 2.3.0
: Wed Mar 25 2015 - 00:01:57 CET