summaryrefslogtreecommitdiff
path: root/response.c
diff options
context:
space:
mode:
authorMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-13 20:54:45 -0400
committerMichael J. Chudobiak <mjc@avtechpulse.com>2012-08-13 20:54:45 -0400
commit0b3ae523971cd3bfae93dbffe202285e5a435520 (patch)
tree20d7562036e603cc4c44c7715d3867cb9275b106 /response.c
parentfc17e46aefc3b5f4e2d4dda8e09f9fa6533377be (diff)
let parser handle command prompt generation
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");