diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-13 20:54:45 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-13 20:54:45 -0400 |
commit | 0b3ae523971cd3bfae93dbffe202285e5a435520 (patch) | |
tree | 20d7562036e603cc4c44c7715d3867cb9275b106 /response.c | |
parent | fc17e46aefc3b5f4e2d4dda8e09f9fa6533377be (diff) |
let parser handle command prompt generation
Diffstat (limited to 'response.c')
-rw-r--r-- | response.c | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -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"); |