mirror of
https://github.com/lloeki/cblocks-clobj.git
synced 2025-12-06 10:44:40 +01:00
output blocks up to double-spaces
This commit is contained in:
parent
e4bef3fbe0
commit
9916ebe0bc
1 changed files with 8 additions and 9 deletions
15
main.c
15
main.c
|
|
@ -80,16 +80,15 @@ void Post_printf(Post *self) {
|
||||||
char *nosp = NULL;
|
char *nosp = NULL;
|
||||||
for (char *buf = self->body; *buf != '\0'; buf++) {
|
for (char *buf = self->body; *buf != '\0'; buf++) {
|
||||||
if (*buf != ' ') {
|
if (*buf != ' ') {
|
||||||
nosp = nosp == NULL ? buf : nosp;
|
if (*buf == '\n') {
|
||||||
|
printf("\n");
|
||||||
} else {
|
} else {
|
||||||
if (nosp != NULL) {
|
nosp = nosp == NULL ? buf : nosp;
|
||||||
fwrite(nosp, sizeof(char), buf - nosp, stdout);
|
|
||||||
nosp = NULL;
|
|
||||||
}
|
}
|
||||||
if (*(buf+1) != ' ' &&
|
} else {
|
||||||
*(buf+1) != '\0' &&
|
if (nosp != NULL && *(buf+1) == ' ') {
|
||||||
*(buf+1) != '\n') {
|
fwrite(nosp, sizeof(char), buf+1 - nosp, stdout);
|
||||||
printf(" ");
|
nosp = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue