mu: fix C-d handler for mu server

This commit is contained in:
djcb
2016-08-27 18:58:31 +03:00
parent 2507933176
commit 6a421f4d85

View File

@ -188,9 +188,9 @@ print_and_clear_g_error (GError **err)
static GHashTable* static GHashTable*
read_command_line (GError **err) read_command_line (GError **err)
{ {
char *line; char *line;
GHashTable *hash; GHashTable *hash;
GString *gstr; GString *gstr;
line = NULL; line = NULL;
gstr = g_string_sized_new (512); gstr = g_string_sized_new (512);
@ -1632,17 +1632,17 @@ mu_cmd_server (MuStore *store, MuConfig *opts/*unused*/, GError **err)
* strings. returning NULL indicates an error */ * strings. returning NULL indicates an error */
my_err = NULL; my_err = NULL;
args = read_command_line (&my_err); args = read_command_line (&my_err);
if ((!args || g_hash_table_size(args) == 0) && !my_err) { if (!args) {
if (args) if (feof(stdin))
g_hash_table_destroy (args); break;
continue; if (my_err)
} else if (my_err) { print_and_clear_g_error (&my_err);
print_and_clear_g_error (&my_err);
continue; continue;
} }
switch (handle_args (&ctx, args, &my_err)) { switch (handle_args (&ctx, args, &my_err)) {
case MU_OK: break; case MU_OK:
break;
case MU_STOP: case MU_STOP:
do_quit = TRUE; do_quit = TRUE;
break; break;