diff options
author | Jim Meyering <jim@meyering.net> | 1997-06-11 20:18:15 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-06-11 20:18:15 +0000 |
commit | 8406b91aba3da0a5ce5f73ff6b7841b1b0a9cc98 (patch) | |
tree | 3f9338a38f7e7301a9069deb925ef35169c413f1 /src | |
parent | 2078f2391e20d1d1ad1d1539658a0ac46df27f05 (diff) | |
download | coreutils-8406b91aba3da0a5ce5f73ff6b7841b1b0a9cc98.tar.xz |
(docolon): Test (re_buffer.re_nsub > 0) rather than
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'.
Diffstat (limited to 'src')
-rw-r--r-- | src/expr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c index 8675438f4..44905b091 100644 --- 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); |