projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve doxygen description of mood.c.
[paraslash.git]
/
color.c
diff --git
a/color.c
b/color.c
index bd09446c17ef9a7654b65960e165c85c14d7097b..0e2beeb0cac4f703668a666db4b57ab954c27c0e 100644
(file)
--- a/
color.c
+++ b/
color.c
@@
-1,7
+1,7
@@
/** \file color.c Functions for printing colored messages. */
/*
/** \file color.c Functions for printing colored messages. */
/*
- * Mostly taken from the git source tree, version 1.6.1.76, January 200
8
.
+ * Mostly taken from the git source tree, version 1.6.1.76, January 200
9
.
*/
#include "para.h"
*/
#include "para.h"
@@
-47,11
+47,9
@@
static int parse_attr(const char *name, int len)
* \param value Human-readable color spec.
* \param dst Result pointer for the escape sequence.
*
* \param value Human-readable color spec.
* \param dst Result pointer for the escape sequence.
*
- * \return -1 on errors, 1 on success.
- *
* Format of \a value: [fg [bg]] [attr].
*/
* Format of \a value: [fg [bg]] [attr].
*/
-
int color_pars
e(const char *value, char *dst)
+
void color_parse_or_di
e(const char *value, char *dst)
{
const char *ptr = value;
int attr = -1;
{
const char *ptr = value;
int attr = -1;
@@
-60,7
+58,7
@@
int color_parse(const char *value, char *dst)
if (!strcasecmp(value, "reset")) {
strcpy(dst, COLOR_RESET);
if (!strcasecmp(value, "reset")) {
strcpy(dst, COLOR_RESET);
- return
1
;
+ return;
}
/* [fg [bg]] [attr] */
}
/* [fg [bg]] [attr] */
@@
-68,11
+66,11
@@
int color_parse(const char *value, char *dst)
const char *word = ptr;
int val, len = 0;
const char *word = ptr;
int val, len = 0;
- while (word[len] && !isspace(word[len]))
+ while (word[len] && !
para_
isspace(word[len]))
len++;
ptr = word + len;
len++;
ptr = word + len;
- while (*ptr && isspace(*ptr))
+ while (*ptr &&
para_
isspace(*ptr))
ptr++;
val = parse_color(word, len);
ptr++;
val = parse_color(word, len);
@@
-113,7
+111,7
@@
int color_parse(const char *value, char *dst)
}
}
if (bg >= 0) {
}
}
if (bg >= 0) {
- if (sep
++
)
+ if (sep)
*dst++ = ';';
if (bg < 8) {
*dst++ = '4';
*dst++ = ';';
if (bg < 8) {
*dst++ = '4';
@@
-125,8
+123,8
@@
int color_parse(const char *value, char *dst)
*dst++ = 'm';
}
*dst = 0;
*dst++ = 'm';
}
*dst = 0;
- return
1
;
+ return;
bad:
bad:
- PARA_E
RROR
_LOG("bad color value '%s'\n", value);
-
return -1
;
+ PARA_E
MERG
_LOG("bad color value '%s'\n", value);
+
exit(EXIT_FAILURE)
;
}
}