File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -340,14 +340,18 @@ gpgme_ctx_t webpgPluginAPI::get_gpgme_ctx()
340
340
#endif
341
341
342
342
err = gpgme_new (&ctx);
343
- gpgme_engine_info_t engine_info = gpgme_ctx_get_engine_info (ctx);
344
- err = gpgme_ctx_set_engine_info (ctx, engine_info->protocol ,
345
- (GNUPGBIN.length () > 0 ) ? (char *) GNUPGBIN.c_str () : NULL ,
346
- (GNUPGHOME.length () > 0 ) ? (char *) GNUPGHOME.c_str () : NULL );
343
+ if (GNUPGBIN.length () > 0
344
+ || GNUPGHOME.length () > 0 ) {
345
+ gpgme_engine_info_t engine_info = gpgme_ctx_get_engine_info (ctx);
346
+ err = gpgme_ctx_set_engine_info (ctx, engine_info->protocol ,
347
+ (GNUPGBIN.length () > 0 ) ? (char *) GNUPGBIN.c_str () : NULL ,
348
+ (GNUPGHOME.length () > 0 ) ? (char *) GNUPGHOME.c_str () : NULL );
349
+ }
347
350
348
351
// Check the GPGCONF variable, if not null, set the GPGCONF
349
352
// engine to use that path
350
- err = gpgme_ctx_set_engine_info (ctx, GPGME_PROTOCOL_GPGCONF,
353
+ if (GPGCONF.length () > 0 )
354
+ err = gpgme_ctx_set_engine_info (ctx, GPGME_PROTOCOL_GPGCONF,
351
355
(GPGCONF.length () > 0 ) ? (char *) GPGCONF.c_str () : NULL , NULL );
352
356
353
357
gpgme_set_textmode (ctx, 1 );
You can’t perform that action at this time.
0 commit comments