mirror of
https://github.com/vale981/bspwm
synced 2025-03-06 02:01:42 -05:00
parent
09c603a85e
commit
5f74f080b3
2 changed files with 4 additions and 11 deletions
12
bspc.c
12
bspc.c
|
@ -73,9 +73,8 @@ int main(int argc, char *argv[])
|
|||
if (send(fd, msg, msg_len, 0) == -1)
|
||||
err("Failed to send the data.\n");
|
||||
|
||||
int ret = 0, nb, p;
|
||||
int ret = 0, nb;
|
||||
while ((nb = recv(fd, rsp, sizeof(rsp)-1, 0)) > 0) {
|
||||
int peek = recv(fd, &p, 1, MSG_PEEK);
|
||||
if (nb == 1 && rsp[0] < MSG_LENGTH) {
|
||||
ret = rsp[0];
|
||||
if (ret == MSG_UNKNOWN) {
|
||||
|
@ -84,15 +83,8 @@ int main(int argc, char *argv[])
|
|||
warn("Invalid syntax.\n");
|
||||
}
|
||||
} else {
|
||||
rsp[nb--] = '\0';
|
||||
if (peek > 0) {
|
||||
rsp[nb] = '\0';
|
||||
printf("%s", rsp);
|
||||
} else {
|
||||
while (nb >= 0 && isspace(rsp[nb])) {
|
||||
rsp[nb--] = '\0';
|
||||
}
|
||||
printf("%s\n", rsp);
|
||||
}
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1148,6 +1148,7 @@ int get_setting(coordinates_t loc, char *name, FILE* rsp)
|
|||
#undef GETBOOL
|
||||
else
|
||||
return MSG_FAILURE;
|
||||
fprintf(rsp, "\n");
|
||||
return MSG_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue