diff options
Diffstat (limited to 'src/webui.c')
-rw-r--r-- | src/webui.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/webui.c b/src/webui.c index 757b0e765..04b9014cf 100644 --- a/src/webui.c +++ b/src/webui.c @@ -391,7 +391,7 @@ http_handle_maps (struct evhttp_request *req, gpointer arg) struct rspamd_webui_worker_ctx *ctx = arg; struct evbuffer *evb; GList *cur; - struct rspamd_map *map; + struct rspamd_map *map, *next; gboolean editable; evb = evbuffer_new (); @@ -411,9 +411,12 @@ http_handle_maps (struct evhttp_request *req, gpointer arg) if (map->protocol == MAP_PROTO_FILE && map->description != NULL) { if (access (map->uri, R_OK) == 0) { editable = access (map->uri, W_OK) == 0; + if (cur->next) { + next = cur->next->data; + } evbuffer_add_printf (evb, "{\"map\":%u,\"description\":\"%s\",\"editable\":%s%s", map->id, map->description, editable ? "true" : "false", - g_list_next (cur) ? "}," : "}"); + (next->protocol == MAP_PROTO_FILE && next->description) ? "}," : "}"); } } cur = g_list_next (cur); |