diff options
author | Wolf Bergenheim <ext-wolf.2.bergenheim@nokia.com> | 2010-09-15 12:20:48 +0300 |
---|---|---|
committer | Wolf Bergenheim <ext-wolf.2.bergenheim@nokia.com> | 2010-09-15 12:20:48 +0300 |
commit | f40836828e0d910b0fcc92de944a910fcec4e651 (patch) | |
tree | 2b9941e991e3c98cc0a6a8eabf3105a298ae5b39 | |
parent | 9287455d766485555c93ee39f6f778a94d8ff343 (diff) |
Added exit/quit commands
-rw-r--r-- | client/client.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/client/client.c b/client/client.c index 1ab8af6..ffaf321 100644 --- a/client/client.c +++ b/client/client.c @@ -260,7 +260,7 @@ static void accept_input(int accept) static void print_input(void) { if (input.accept) { - printf(">%s", input.buf); + printf("resource> %s", input.buf); fflush(stdout); } } @@ -419,6 +419,11 @@ static void parse_input(void) str = skip_whitespaces(str + 4); flood = count = 0; } + else if ((!strncmp(str, "quit", 4)) || (!strncmp(str, "exit", 4))) { + g_main_loop_quit(main_loop); + input.accept = 0; + return; + } else { print_message("invalid input '%s'", input.buf); return; |