summaryrefslogtreecommitdiff
path: root/response.c
diff options
context:
space:
mode:
Diffstat (limited to 'response.c')
-rw-r--r--response.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/response.c b/response.c
index d6bfcc1..db008dd 100644
--- a/response.c
+++ b/response.c
@@ -94,20 +94,14 @@ static void writeOutput(GPollableOutputStream* stream, gchar* data)
gssize written_bytes = 0;
gchar *terminated;
- if(data==NULL) {
+ if (data==NULL) {
terminated = g_strdup("\r\n");
+ } else if (!strlen(data)) {
+ terminated = g_strdup("> ");
} else {
terminated = g_strdup_printf ("%s\r\n", data);
}
-// if(!strlen(out)) {
-// strcpy(out, " ");
-// }
-//
-// if(out[strlen(out)-1] != '\n' && out[strlen(out)-1] != '\r') {
-// strcat(out, "\n");
-// }
-
written_bytes = g_pollable_output_stream_write_nonblocking(stream, terminated, strlen(terminated), NULL, NULL);
if (written_bytes == -1) {
g_print("Could not send message to client\n");