#include "lisp.h"
#include "buffer.h"
#include "syntax.h"
+#include "lib/str.h"
#else /* not emacs */
static int ctype (const char *name)
{
- if (0 == strcmp (name, "alnum"))
+ if (0 == mutt_strcmp (name, "alnum"))
return MUTT_ALNUM;
- if (0 == strcmp (name, "alpha"))
+ if (0 == mutt_strcmp (name, "alpha"))
return MUTT_ALPHA;
- if (0 == strcmp (name, "blank"))
+ if (0 == mutt_strcmp (name, "blank"))
return MUTT_BLANK;
- if (0 == strcmp (name, "cntrl"))
+ if (0 == mutt_strcmp (name, "cntrl"))
return MUTT_CNTRL;
- if (0 == strcmp (name, "digit"))
+ if (0 == mutt_strcmp (name, "digit"))
return MUTT_DIGIT;
- if (0 == strcmp (name, "graph"))
+ if (0 == mutt_strcmp (name, "graph"))
return MUTT_GRAPH;
- if (0 == strcmp (name, "lower"))
+ if (0 == mutt_strcmp (name, "lower"))
return MUTT_LOWER;
- if (0 == strcmp (name, "print"))
+ if (0 == mutt_strcmp (name, "print"))
return MUTT_PRINT;
- if (0 == strcmp (name, "punct"))
+ if (0 == mutt_strcmp (name, "punct"))
return MUTT_PUNCT;
- if (0 == strcmp (name, "space"))
+ if (0 == mutt_strcmp (name, "space"))
return MUTT_SPACE;
- if (0 == strcmp (name, "upper"))
+ if (0 == mutt_strcmp (name, "upper"))
return MUTT_UPPER;
- if (0 == strcmp (name, "xdigit"))
+ if (0 == mutt_strcmp (name, "xdigit"))
return MUTT_XDIGIT;
return MUTT_INVALID;
}
#define BYTEWIDTH 8 /* In bits. */
-#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
+#define STREQ(s1, s2) ((mutt_strcmp (s1, s2) == 0))
#undef MAX
#undef MIN
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;
- else
+ } else {
FREE_STACK_RETURN (REG_ERPAREN);
+ }
+ }
handle_close:
if (fixup_alt_jump) { /* Push a dummy failure point at the end of the
}
/* 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;
- else
+ } else {
FREE_STACK_RETURN (REG_ERPAREN);
+ }
+ }
/* Since we just checked for an empty stack above, this
``can't happen''. */
/* Match anchors at newlines. */
re_comp_buf.newline_anchor = 1;
- ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
+ ret = regex_compile (s, mutt_strlen (s), re_syntax_options, &re_comp_buf);
if (!ret)
return NULL;
re_exec (s)
const char *s;
{
- const int len = strlen (s);
+ const int len = mutt_strlen (s);
return
0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
preg->no_sub = !!(cflags & REG_NOSUB);
/* POSIX says a null character in the pattern terminates it, so we
- can use strlen here in compiling the pattern. */
- ret = regex_compile (pattern, strlen (pattern), syntax, preg);
+ can use mutt_strlen here in compiling the pattern. */
+ ret = regex_compile (pattern, mutt_strlen (pattern), syntax, preg);
/* POSIX doesn't distinguish between an unmatched open-group and an
unmatched close-group: both are REG_EPAREN. */
int ret;
struct re_registers regs;
regex_t private_preg;
- int len = strlen (string);
+ int len = mutt_strlen (string);
boolean want_reg_info = !preg->no_sub && nmatch > 0;
private_preg = *preg;
msg = gettext (re_error_msgid[errcode]);
- msg_size = strlen (msg) + 1; /* Includes the null. */
+ msg_size = mutt_strlen (msg) + 1; /* Includes the null. */
if (errbuf_size != 0) {
if (msg_size > errbuf_size) {