part of the template-handling code was in #ifdef X11, which caused conky to dump core when
compiled without x11.
as a bonus, I changed tests !=' ' to !isspace in two places as it was causing strange effects
Signed-off-by: Brenden Matthews <brenden@rty.ca>
if (*(p + 1) == '{') {
p += 2;
templ = p;
if (*(p + 1) == '{') {
p += 2;
templ = p;
- while (*p && *p != ' ' && *p != '{' && *p != '}')
+ while (*p && !isspace(*p) && *p != '{' && *p != '}')
p++;
if (*p == '}')
args = NULL;
p++;
if (*p == '}')
args = NULL;
}
} else {
templ = p + 1;
}
} else {
templ = p + 1;
- while (*p && *p != ' ')
+ while (*p && !isspace(*p))
- if(*p)
- *(p++) = '\0';
args = NULL;
}
tmpl_out = handle_template(templ, args);
args = NULL;
}
tmpl_out = handle_template(templ, args);
XFreeGC(display, window.gc);
free_fonts();
XFreeGC(display, window.gc);
free_fonts();
- for (i = 0; i < 10; i ++) {
- if (template[i]) {
- free(template[i]);
- template[i] = NULL;
- }
- }
+ for (i = 0; i < 10; i ++) {
+ if (template[i]) {
+ free(template[i]);
+ template[i] = NULL;
+ }
+ }
+
free_text_objects(&global_root_object, 0);
if (tmpstring1) {
free(tmpstring1);
free_text_objects(&global_root_object, 0);
if (tmpstring1) {
free(tmpstring1);
#ifdef X11
show_graph_scale = 0;
show_graph_range = 0;
#ifdef X11
show_graph_scale = 0;
show_graph_range = 0;
- template[0] = strdup("");
- template[1] = strdup("");
- template[2] = strdup("");
- template[3] = strdup("");
- template[4] = strdup("");
- template[5] = strdup("");
- template[6] = strdup("");
- template[7] = strdup("");
- template[8] = strdup("");
- template[9] = strdup("");
draw_shades = 1;
draw_borders = 0;
draw_graph_borders = 1;
draw_shades = 1;
draw_borders = 0;
draw_graph_borders = 1;
info.x11.monitor.current = 0;
#endif /* X11 */
info.x11.monitor.current = 0;
#endif /* X11 */
+ template[0] = strdup("");
+ template[1] = strdup("");
+ template[2] = strdup("");
+ template[3] = strdup("");
+ template[4] = strdup("");
+ template[5] = strdup("");
+ template[6] = strdup("");
+ template[7] = strdup("");
+ template[8] = strdup("");
+ template[9] = strdup("");
+
free(current_mail_spool);
{
char buf[256];
free(current_mail_spool);
{
char buf[256];
#define TEMPLATE_CONF(n) \
CONF("template"#n) { \
if (value) { \
#define TEMPLATE_CONF(n) \
CONF("template"#n) { \
if (value) { \
TEMPLATE_CONF(7)
TEMPLATE_CONF(8)
TEMPLATE_CONF(9)
TEMPLATE_CONF(7)
TEMPLATE_CONF(8)
TEMPLATE_CONF(9)
CONF("imap") {
if (value) {
info.mail = parse_mail_args(IMAP_TYPE, value);
CONF("imap") {
if (value) {
info.mail = parse_mail_args(IMAP_TYPE, value);