gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] branch master updated: make replace work nicer


From: gnunet
Subject: [taler-anastasis] branch master updated: make replace work nicer
Date: Mon, 05 Jul 2021 08:51:11 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 5affd3a  make replace work nicer
5affd3a is described below

commit 5affd3ac26734c0adca50dad29cd271f2dbd53e6
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Mon Jul 5 08:50:58 2021 +0200

    make replace work nicer
---
 src/reducer/anastasis_api_backup_redux.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/reducer/anastasis_api_backup_redux.c 
b/src/reducer/anastasis_api_backup_redux.c
index 18d68b3..60430d7 100644
--- a/src/reducer/anastasis_api_backup_redux.c
+++ b/src/reducer/anastasis_api_backup_redux.c
@@ -1958,14 +1958,28 @@ add_policy (json_t *state,
   /* add new policy to array of existing policies */
   {
     json_t *policy;
+    json_t *idx;
 
     policy = json_pack ("{s:o}",
                         "methods",
                         methods);
     GNUNET_assert (NULL != policy);
-    GNUNET_assert (0 ==
-                   json_array_append_new (policies,
-                                          policy));
+    idx = json_object_get (arguments,
+                           "policy_index");
+    if ( (NULL == idx) ||
+         (! json_is_integer (idx)) )
+    {
+      GNUNET_assert (0 ==
+                     json_array_append_new (policies,
+                                            policy));
+    }
+    else
+    {
+      GNUNET_assert (0 ==
+                     json_array_insert_new (policies,
+                                            json_integer_value (idx),
+                                            policy));
+    }
   }
 
   cb (cb_cls,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]