aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2013-01-06 20:39:47 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2013-01-06 20:39:47 +0400
commit6081307a32ddcce5b03a03be5c9945364dc3a895 (patch)
treeac7b8e6296f3db21ad272b6ff35bdf543d49bbcf /src
parentdb51847d220edd4218329b1cbd815f97eb11aabd (diff)
downloadrspamd-6081307a32ddcce5b03a03be5c9945364dc3a895.tar.gz
rspamd-6081307a32ddcce5b03a03be5c9945364dc3a895.zip
Json ',' fix.
Diffstat (limited to 'src')
-rw-r--r--src/webui.c7
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);