mirror of
git://projects.qi-hardware.com/antorcha.git
synced 2024-11-01 07:24:58 +02:00
tools/libtxt/edit.c (text2edit): correct handling of newlines
This commit is contained in:
parent
3faf58c601
commit
60e9a1e919
@ -181,8 +181,8 @@ struct edit *text2edit(const char *s)
|
|||||||
if (s != start) {
|
if (s != start) {
|
||||||
add_string(&last, start, s-start);
|
add_string(&last, start, s-start);
|
||||||
have_text = 1;
|
have_text = 1;
|
||||||
start = s+1;
|
|
||||||
}
|
}
|
||||||
|
start = s+1;
|
||||||
|
|
||||||
if (*s == '\n' && !have_text)
|
if (*s == '\n' && !have_text)
|
||||||
continue;
|
continue;
|
||||||
@ -195,8 +195,10 @@ struct edit *text2edit(const char *s)
|
|||||||
*last = e;
|
*last = e;
|
||||||
last = &e->next;
|
last = &e->next;
|
||||||
|
|
||||||
if (*s == '\n')
|
if (*s == '\n') {
|
||||||
|
have_text = 0;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
end = strchr(s, '>');
|
end = strchr(s, '>');
|
||||||
if (!end)
|
if (!end)
|
||||||
|
Loading…
Reference in New Issue
Block a user