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]
/
color.c
diff --git
a/color.c
b/color.c
index
f024078
..
69e444e
100644
(file)
--- a/
color.c
+++ b/
color.c
@@
-15,6
+15,10
@@
#include "mutt_curses.h"
#include "mapping.h"
#include "mutt_curses.h"
#include "mapping.h"
+#include "lib/mem.h"
+#include "lib/intl.h"
+#include "lib/str.h"
+
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
@@
-293,13
+297,13
@@
parse_color_name (const char *s, int *col, int *attr, int brite, BUFFER * err)
{
char *eptr;
{
char *eptr;
- if (
mutt
_strncasecmp (s, "bright", 6) == 0) {
+ if (
safe
_strncasecmp (s, "bright", 6) == 0) {
*attr |= brite;
s += 6;
}
/* allow aliases for xterm color resources */
*attr |= brite;
s += 6;
}
/* allow aliases for xterm color resources */
- if (
mutt
_strncasecmp (s, "color", 5) == 0) {
+ if (
safe
_strncasecmp (s, "color", 5) == 0) {
s += 5;
*col = strtol (s, &eptr, 10);
if (!*s || *eptr || *col < 0 ||
s += 5;
*col = strtol (s, &eptr, 10);
if (!*s || *eptr || *col < 0 ||
@@
-359,7
+363,7
@@
_mutt_parse_uncolor (BUFFER * buf, BUFFER * s, unsigned long data,
return (-1);
}
return (-1);
}
- if (
mutt
_strncmp (buf->data, "index", 5) != 0) {
+ if (
safe
_strncmp (buf->data, "index", 5) != 0) {
snprintf (err->data, err->dsize,
_("%s: command valid only for index object"),
parse_uncolor ? "uncolor" : "unmono");
snprintf (err->data, err->dsize,
_("%s: command valid only for index object"),
parse_uncolor ? "uncolor" : "unmono");
@@
-397,7
+401,7
@@
_mutt_parse_uncolor (BUFFER * buf, BUFFER * s, unsigned long data,
do {
mutt_extract_token (buf, s, 0);
do {
mutt_extract_token (buf, s, 0);
- if (!
mutt
_strcmp ("*", buf->data)) {
+ if (!
safe
_strcmp ("*", buf->data)) {
for (tmp = ColorIndexList; tmp;) {
if (!do_cache)
do_cache = 1;
for (tmp = ColorIndexList; tmp;) {
if (!do_cache)
do_cache = 1;
@@
-410,7
+414,7
@@
_mutt_parse_uncolor (BUFFER * buf, BUFFER * s, unsigned long data,
else {
for (last = NULL, tmp = ColorIndexList; tmp;
last = tmp, tmp = tmp->next) {
else {
for (last = NULL, tmp = ColorIndexList; tmp;
last = tmp, tmp = tmp->next) {
- if (!
mutt
_strcmp (buf->data, tmp->pattern)) {
+ if (!
safe
_strcmp (buf->data, tmp->pattern)) {
if (!do_cache)
do_cache = 1;
dprint (1,
if (!do_cache)
do_cache = 1;
dprint (1,
@@
-454,11
+458,11
@@
add_pattern (COLOR_LINE ** top, const char *s, int sensitive,
while (tmp) {
if (sensitive) {
while (tmp) {
if (sensitive) {
- if (
mutt
_strcmp (s, tmp->pattern) == 0)
+ if (
safe
_strcmp (s, tmp->pattern) == 0)
break;
}
else {
break;
}
else {
- if (
mutt
_strcasecmp (s, tmp->pattern) == 0)
+ if (
safe
_strcasecmp (s, tmp->pattern) == 0)
break;
}
tmp = tmp->next;
break;
}
tmp = tmp->next;
@@
-534,7
+538,7
@@
parse_object (BUFFER * buf, BUFFER * s, int *o, int *ql, BUFFER * err)
}
mutt_extract_token (buf, s, 0);
}
mutt_extract_token (buf, s, 0);
- if (!
mutt
_strncmp (buf->data, "quoted", 6)) {
+ if (!
safe
_strncmp (buf->data, "quoted", 6)) {
if (buf->data[6]) {
*ql = strtol (buf->data + 6, &eptr, 10);
if (*eptr || q_level < 0) {
if (buf->data[6]) {
*ql = strtol (buf->data + 6, &eptr, 10);
if (*eptr || q_level < 0) {