1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-11-22 12:42:27 +02:00

tools/libtxt/edit.c (text2edit): correct handling of newlines

This commit is contained in:
Werner Almesberger 2012-06-30 14:57:45 -03:00
parent 3faf58c601
commit 60e9a1e919

View File

@ -181,8 +181,8 @@ struct edit *text2edit(const char *s)
if (s != start) {
add_string(&last, start, s-start);
have_text = 1;
start = s+1;
}
start = s+1;
if (*s == '\n' && !have_text)
continue;
@ -195,8 +195,10 @@ struct edit *text2edit(const char *s)
*last = e;
last = &e->next;
if (*s == '\n')
if (*s == '\n') {
have_text = 0;
continue;
}
end = strchr(s, '>');
if (!end)