* [gentoo-commits] proj/openrc:master commit in: src/libeinfo/
@ 2013-01-04 14:51 William Hubbs
0 siblings, 0 replies; 4+ messages in thread
From: William Hubbs @ 2013-01-04 14:51 UTC (permalink / raw
To: gentoo-commits
commit: 3896b9d55ce76e41233eadb6d0ede2f8115736d3
Author: Andrew Gregory <andrew.gregory.8 <AT> gmail <DOT> com>
AuthorDate: Wed Oct 31 15:49:20 2012 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Fri Jan 4 14:48:08 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=3896b9d5
libeinfo: check for "color" in the terminal name
Signed-off-by: Andrew Gregory <andrew.gregory.8 <AT> gmail.com>
---
src/libeinfo/libeinfo.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c
index 98cec92..6f0ca76 100644
--- a/src/libeinfo/libeinfo.c
+++ b/src/libeinfo/libeinfo.c
@@ -150,11 +150,11 @@ static bool term_is_cons25 = false;
static char termcapbuf[2048];
static char tcapbuf[512];
#else
-/* No curses support, so we hardcode a list of colour capable terms */
+/* No curses support, so we hardcode a list of colour capable terms
+ * Only terminals without "color" in the name need to be explicitly listed */
static const char *const color_terms[] = {
"Eterm",
"ansi",
- "color-xterm",
"con132x25",
"con132x30",
"con132x43",
@@ -174,7 +174,6 @@ static const char *const color_terms[] = {
"kterm",
"linux",
"linux-c",
- "mach-color",
"mlterm",
"putty",
"rxvt",
@@ -189,8 +188,6 @@ static const char *const color_terms[] = {
"vt220",
"wsvt25",
"xterm",
- "xterm-256color",
- "xterm-color",
"xterm-debian",
NULL
};
@@ -402,7 +399,10 @@ colour_terminal(FILE * EINFO_RESTRICT f)
* which is not available to us when we boot */
if (term_is_cons25 || strcmp(term, "wsvt25") == 0) {
#else
- while (color_terms[i]) {
+ if (strstr(term, "color"))
+ in_colour = 1;
+
+ while (color_terms[i] && in_colour != 1) {
if (strcmp(color_terms[i], term) == 0) {
in_colour = 1;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/openrc:master commit in: src/libeinfo/
@ 2016-07-13 22:15 William Hubbs
0 siblings, 0 replies; 4+ messages in thread
From: William Hubbs @ 2016-07-13 22:15 UTC (permalink / raw
To: gentoo-commits
commit: 7f84b5d741c150cd159d5a3cda3ef532f0381826
Author: Jaromil <jaromil <AT> dyne <DOT> org>
AuthorDate: Thu Jun 2 10:15:08 2016 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Wed Jul 13 22:04:28 2016 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=7f84b5d7
libeinfo: document the x suffix on function names
This fixes #88.
src/libeinfo/einfo.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/libeinfo/einfo.h b/src/libeinfo/einfo.h
index 58aedd9..83c2a79 100644
--- a/src/libeinfo/einfo.h
+++ b/src/libeinfo/einfo.h
@@ -71,6 +71,7 @@ void elog(int, const char * EINFO_RESTRICT, ...) EINFO_PRINTF(2, 3);
*
* The n suffix denotes that no new line should be printed.
* The v suffix means only print if EINFO_VERBOSE is yes.
+ * The x suffix means function will exit() returning failure.
*/
/*@{*/
int einfon(const char * __EINFO_RESTRICT, ...) EINFO_PRINTF(1, 2);
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/openrc:master commit in: src/libeinfo/
@ 2018-06-19 21:34 William Hubbs
0 siblings, 0 replies; 4+ messages in thread
From: William Hubbs @ 2018-06-19 21:34 UTC (permalink / raw
To: gentoo-commits
commit: 8a945194afb106428bc700e751078ef9944ee617
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Tue Jun 19 18:52:40 2018 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Tue Jun 19 18:52:40 2018 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=8a945194
libeinfo: clean up gcc 7 compiler warnings
src/libeinfo/libeinfo.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c
index 198af0f4..5a637ffc 100644
--- a/src/libeinfo/libeinfo.c
+++ b/src/libeinfo/libeinfo.c
@@ -883,7 +883,7 @@ eindent(void)
{
char *env = getenv("EINFO_INDENT");
int amount = 0;
- char num[10];
+ char *num;
if (env) {
errno = 0;
@@ -894,8 +894,9 @@ eindent(void)
amount += INDENT_WIDTH;
if (amount > INDENT_MAX)
amount = INDENT_MAX;
- snprintf(num, 10, "%08d", amount);
+ xasprintf(&num, "%08d", amount);
setenv("EINFO_INDENT", num, 1);
+ free(num);
}
hidden_def(eindent)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/openrc:master commit in: src/libeinfo/
@ 2018-06-20 17:37 William Hubbs
0 siblings, 0 replies; 4+ messages in thread
From: William Hubbs @ 2018-06-20 17:37 UTC (permalink / raw
To: gentoo-commits
commit: 19bf49a710f27d4774ed4c6372d87d6ba15f189e
Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Wed Jun 20 17:36:51 2018 +0000
Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Wed Jun 20 17:36:51 2018 +0000
URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=19bf49a7
libeinfo: convert remaining snprintf calls to xasprintf
src/libeinfo/libeinfo.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c
index 5a637ffc..b8064540 100644
--- a/src/libeinfo/libeinfo.c
+++ b/src/libeinfo/libeinfo.c
@@ -904,7 +904,7 @@ void eoutdent(void)
{
char *env = getenv("EINFO_INDENT");
int amount = 0;
- char num[10];
+ char *num = NULL;
int serrno = errno;
if (!env)
@@ -918,8 +918,9 @@ void eoutdent(void)
if (amount <= 0)
unsetenv("EINFO_INDENT");
else {
- snprintf(num, 10, "%08d", amount);
+ xasprintf(&num, "%08d", amount);
setenv("EINFO_INDENT", num, 1);
+ free(num);
}
errno = serrno;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-06-20 17:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-20 17:37 [gentoo-commits] proj/openrc:master commit in: src/libeinfo/ William Hubbs
-- strict thread matches above, loose matches on Subject: below --
2018-06-19 21:34 William Hubbs
2016-07-13 22:15 William Hubbs
2013-01-04 14:51 William Hubbs
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox