summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e2b7eea)
raw | patch | inline | side by side (parent: e2b7eea)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 4 Jan 2012 17:33:30 +0000 (18:33 +0100) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Wed, 23 May 2012 01:50:07 +0000 (03:50 +0200) |
src/screen_text.c | patch | blob | history | |
src/screen_text.h | patch | blob | history |
diff --git a/src/screen_text.c b/src/screen_text.c
index 244903dd85a8645b0e05797f07a56c8eacc84d14..03a8fc57866bbba006b9d3ce7f6a2e39ea42371b 100644 (file)
--- a/src/screen_text.c
+++ b/src/screen_text.c
}
void
-screen_text_set(struct screen_text *text, const char *str)
+screen_text_append(struct screen_text *text, const char *str)
{
const char *eol, *next;
assert(str != NULL);
- screen_text_clear(text);
-
while ((eol = strchr(str, '\n')) != NULL) {
char *line;
diff --git a/src/screen_text.h b/src/screen_text.h
index 3d9327c4997030717ec81a3f67e44c083bd1b008..1b688f780fdf5b5eefb471f780ddd474738779a2 100644 (file)
--- a/src/screen_text.h
+++ b/src/screen_text.h
}
void
-screen_text_set(struct screen_text *text, const char *str);
+screen_text_append(struct screen_text *text, const char *str);
+
+static inline void
+screen_text_set(struct screen_text *text, const char *str)
+{
+ screen_text_clear(text);
+ screen_text_append(text, str);
+}
const char *
screen_text_list_callback(unsigned idx, void *data);