Fix gpgconf option change if not self-assigning.
authorMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Fri, 21 Jan 2011 03:21:30 +0000 (04:21 +0100)
committerMarcus Brinkmann <marcus.brinkmann@ruhr-uni-bochum.de>
Fri, 21 Jan 2011 03:21:30 +0000 (04:21 +0100)
2011-01-21  Marcus Brinkmann  <mb@g10code.com>

        * engine-gpgconf.c (_gpgme_conf_opt_change): Fix the case that is
        not self-assignment.

src/ChangeLog
src/engine-gpgconf.c

index f891d980255e6e4e806735c119def5bbb24161b7..fdd3e49619a7fbc76e33df4128a131fcbf629bfa 100644 (file)
@@ -1,3 +1,8 @@
+2011-01-21  Marcus Brinkmann  <mb@g10code.com>
+
+       * engine-gpgconf.c (_gpgme_conf_opt_change): Fix the case that is
+       not self-assignment.
+
 2010-12-08  Werner Koch  <wk@g10code.com>
 
        * gpgme-tool.c (strcpy_escaped_plus): New.
index d08ed03ca4760f43aa038ba7fcaf8028baec3829..6807dce9cf95188bb64de149d153d7ac70559cd7 100644 (file)
@@ -622,7 +622,7 @@ _gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset, gpgme_conf_arg_t arg)
     {
       if (opt->new_value)
        release_arg (opt->new_value, opt->alt_type);
-     opt->new_value = NULL;
+      opt->new_value = NULL;
       opt->change_value = 0;
     }
   else
@@ -630,10 +630,8 @@ _gpgme_conf_opt_change (gpgme_conf_opt_t opt, int reset, gpgme_conf_arg_t arg)
       /* Support self-assignment, for example for adding an item to an
         existing list.  */
       if (opt->new_value && arg != opt->new_value)
-       {
-         release_arg (opt->new_value, opt->alt_type);
-         opt->new_value = arg;
-       }
+       release_arg (opt->new_value, opt->alt_type);
+      opt->new_value = arg;
       opt->change_value = 1;
     }
   return 0;