summaryrefslogtreecommitdiff
path: root/src/libeinfo
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-05 20:43:32 +0000
committerRoy Marples <roy@marples.name>2008-01-05 20:43:32 +0000
commite6c9bdf2a30d84e35b783146ebe36314b4269ffb (patch)
treef9a3d84e4e70ae56a8d6b56d30fa4425cea1154c /src/libeinfo
parentc92be49041a7b56f651a93e71e15e94bc8727489 (diff)
downloadopenrc-e6c9bdf2a30d84e35b783146ebe36314b4269ffb.tar.gz
openrc-e6c9bdf2a30d84e35b783146ebe36314b4269ffb.tar.bz2
openrc-e6c9bdf2a30d84e35b783146ebe36314b4269ffb.tar.xz
Add the missing changes from the recent Makefile updates
Diffstat (limited to 'src/libeinfo')
-rw-r--r--src/libeinfo/libeinfo.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/libeinfo/libeinfo.c b/src/libeinfo/libeinfo.c
index d80af9c..14f254e 100644
--- a/src/libeinfo/libeinfo.c
+++ b/src/libeinfo/libeinfo.c
@@ -50,10 +50,7 @@ const char libeinfo_copyright[] = "Copyright (c) 2007-2008 Roy Marples";
#include <unistd.h>
#include "einfo.h"
-#include "rc.h"
-#include "rc-misc.h"
-
-#include "hidden-visibility.h"
+#include "../hidden-visibility.h"
hidden_proto(ecolor)
hidden_proto(ebegin)
hidden_proto(ebeginv)
@@ -415,19 +412,20 @@ static bool colour_terminal (FILE * __EINFO_RESTRICT f)
ee += strlen (ecolors[i].name);
if (ee && *ee == '=') {
+ char *d = strdup (ee + 1);
+ if (d) {
+ char *end = strchr (d, ':');
+ if (end)
+ *end = '\0';
- char *d = xstrdup (ee + 1);
- char *end = strchr (d, ':');
- if (end)
- *end = '\0';
+ c = atoi(d);
- c = atoi(d);
-
- end = strchr (d, ';');
- if (end && *++end == '0')
- bold = _me;
+ end = strchr (d, ';');
+ if (end && *++end == '0')
+ bold = _me;
- free (d);
+ free (d);
+ }
}
}
strlcpy (tmp, tgoto (bold, 0, 0), sizeof (tmp));