2005-08-26 Marcus Brinkmann <marcus@g10code.de>
authorMarcus Brinkmann <mb@g10code.com>
Fri, 26 Aug 2005 15:00:18 +0000 (15:00 +0000)
committerMarcus Brinkmann <mb@g10code.com>
Fri, 26 Aug 2005 15:00:18 +0000 (15:00 +0000)
* edit.c (command_handler): Do not depend on PROCESSED being
available.

gpgme/ChangeLog
gpgme/edit.c

index 3c211d93f9ba43e555dfc421dc93dbeb5b6b4053..972f9e3094fd80c141c0778382cdce45625ba186 100644 (file)
@@ -1,5 +1,8 @@
 2005-08-26  Marcus Brinkmann  <marcus@g10code.de>
 
+       * edit.c (command_handler): Do not depend on PROCESSED being
+       available.
+
        * engine.h (engine_command_handler_t): Add new argument processed.
        * ops.h (_gpgme_passphrase_command_handler_internal): Rename
        prototype to ...
index 6ff8fba44eb87ffb758524a426d108ea2798362f..186d4f9dedc4fd61e87406cc148b96a231157e65 100644 (file)
@@ -63,20 +63,21 @@ edit_status_handler (void *priv, gpgme_status_code_t status, char *args)
 
 static gpgme_error_t
 command_handler (void *priv, gpgme_status_code_t status, const char *args,
-                int fd, int *processed)
+                int fd, int *processed_r)
 {
   gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
   gpgme_error_t err;
+  int processed = 0;
 
   if (ctx->passphrase_cb)
     {
       err = _gpgme_passphrase_command_handler (ctx, status, args,
-                                              fd, processed);
+                                              fd, &processed);
       if (err)
        return err;
     }
 
-  if (!*processed)
+  if (!processed)
     {
       void *hook;
       op_data_t opd;
@@ -89,11 +90,12 @@ command_handler (void *priv, gpgme_status_code_t status, const char *args,
       /* FIXME: We expect the user to handle _all_ status codes.
         Later, we may fix the callback interface to allow the user
         indicate if it processed the status code or not.  */
-      *processed = 1;
+      *processed_r = 1;
 
       return (*opd->fnc) (opd->fnc_value, status, args, fd);
     }
 
+  *processed_r = processed;
   return 0;
 }