projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rocco Rutte:
[apps/madmutt.git]
/
regex.c
diff --git
a/regex.c
b/regex.c
index
9db19c5
..
b2755ca
100644
(file)
--- a/
regex.c
+++ b/
regex.c
@@
-98,6
+98,7
@@
#include "lisp.h"
#include "buffer.h"
#include "syntax.h"
#include "lisp.h"
#include "buffer.h"
#include "syntax.h"
+#include "lib/str.h"
#else /* not emacs */
#else /* not emacs */
@@
-2426,11
+2427,13
@@
static reg_errcode_t regex_compile (pattern, size, syntax, bufp)
if (syntax & RE_NO_BK_PARENS)
goto normal_backslash;
if (syntax & RE_NO_BK_PARENS)
goto normal_backslash;
- if (COMPILE_STACK_EMPTY)
- if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ if (COMPILE_STACK_EMPTY)
{
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
{
goto normal_backslash;
goto normal_backslash;
- else
+ } else {
FREE_STACK_RETURN (REG_ERPAREN);
FREE_STACK_RETURN (REG_ERPAREN);
+ }
+ }
handle_close:
if (fixup_alt_jump) { /* Push a dummy failure point at the end of the
handle_close:
if (fixup_alt_jump) { /* Push a dummy failure point at the end of the
@@
-2445,11
+2448,13
@@
static reg_errcode_t regex_compile (pattern, size, syntax, bufp)
}
/* See similar code for backslashed left paren above. */
}
/* See similar code for backslashed left paren above. */
- if (COMPILE_STACK_EMPTY)
- if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ if (COMPILE_STACK_EMPTY)
{
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
{
goto normal_char;
goto normal_char;
- else
+ } else {
FREE_STACK_RETURN (REG_ERPAREN);
FREE_STACK_RETURN (REG_ERPAREN);
+ }
+ }
/* Since we just checked for an empty stack above, this
``can't happen''. */
/* Since we just checked for an empty stack above, this
``can't happen''. */
@@
-5385,7
+5390,7
@@
re_comp (s)
/* Match anchors at newlines. */
re_comp_buf.newline_anchor = 1;
/* Match anchors at newlines. */
re_comp_buf.newline_anchor = 1;
- ret = regex_compile (s,
mutt_
strlen (s), re_syntax_options, &re_comp_buf);
+ ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
if (!ret)
return NULL;
if (!ret)
return NULL;
@@
-5402,7
+5407,7
@@
int
re_exec (s)
const char *s;
{
re_exec (s)
const char *s;
{
- const int len =
mutt_
strlen (s);
+ const int len = strlen (s);
return
0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
return
0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
@@
-5499,8
+5504,8
@@
int regcomp (preg, pattern, cflags)
preg->no_sub = !!(cflags & REG_NOSUB);
/* POSIX says a null character in the pattern terminates it, so we
preg->no_sub = !!(cflags & REG_NOSUB);
/* POSIX says a null character in the pattern terminates it, so we
- can use
mutt_
strlen here in compiling the pattern. */
- ret = regex_compile (pattern,
mutt_
strlen (pattern), syntax, preg);
+ can use strlen here in compiling the pattern. */
+ ret = regex_compile (pattern, strlen (pattern), syntax, preg);
/* POSIX doesn't distinguish between an unmatched open-group and an
unmatched close-group: both are REG_EPAREN. */
/* POSIX doesn't distinguish between an unmatched open-group and an
unmatched close-group: both are REG_EPAREN. */
@@
-5535,7
+5540,7
@@
int regexec (preg, string, nmatch, pmatch, eflags)
int ret;
struct re_registers regs;
regex_t private_preg;
int ret;
struct re_registers regs;
regex_t private_preg;
- int len =
mutt_
strlen (string);
+ int len = strlen (string);
boolean want_reg_info = !preg->no_sub && nmatch > 0;
private_preg = *preg;
boolean want_reg_info = !preg->no_sub && nmatch > 0;
private_preg = *preg;
@@
-5604,7
+5609,7
@@
size_t regerror (errcode, preg, errbuf, errbuf_size)
msg = gettext (re_error_msgid[errcode]);
msg = gettext (re_error_msgid[errcode]);
- msg_size =
mutt_
strlen (msg) + 1; /* Includes the null. */
+ msg_size = strlen (msg) + 1; /* Includes the null. */
if (errbuf_size != 0) {
if (msg_size > errbuf_size) {
if (errbuf_size != 0) {
if (msg_size > errbuf_size) {