projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2078f23
)
(docolon): Test (re_buffer.re_nsub > 0) rather than
author
Jim Meyering
<jim@meyering.net>
Wed, 11 Jun 1997 20:18:15 +0000
(20:18 +0000)
committer
Jim Meyering
<jim@meyering.net>
Wed, 11 Jun 1997 20:18:15 +0000
(20:18 +0000)
searching for `\(' to determine whether to return 0 or the empty
string. Before it would improperly return '' if the pattern
contained a substring like this: `\\('. From Karl Heuer.
For example, running expr c : '\\(' should print `0'.
src/expr.c
patch
|
blob
|
history
diff --git
a/src/expr.c
b/src/expr.c
index 8675438f4366bd48bf0bdc340ff46db11b4d73d0..44905b091f059e67c4f713a4ae3a5f9f949a5efc 100644
(file)
--- a/
src/expr.c
+++ b/
src/expr.c
@@
-456,7
+456,7
@@
of the basic regular expression is not portable; it is being ignored"),
else
{
/* Match failed -- return the right kind of null. */
- if (
strstr (pv->u.s, "\\(")
)
+ if (
re_buffer.re_nsub > 0
)
v = str_value ("");
else
v = int_value (0);