return GTK_WIDGET(viewer->textview->vbox);
}
-static gchar *_get_gpg_executable_name()
-{
- gpgme_engine_info_t e;
-
- if (!gpgme_get_engine_info(&e)) {
- while (e != NULL) {
- if (e->protocol == GPGME_PROTOCOL_OpenPGP
- && e->file_name != NULL) {
- debug_print("Found gpg executable: '%s'\n", e->file_name);
- return e->file_name;
- }
- }
- }
-
- return NULL;
-}
-
#ifdef G_OS_WIN32
struct _ImportCtx {
gboolean done;
}
gpgme_get_key(ctx, sig->fpr, &key, 0);
if (!key) {
- gchar *gpgbin = _get_gpg_executable_name();
+ gchar *gpgbin = get_gpg_executable_name();
gchar *cmd = g_strdup_printf("\"%s\" --no-tty --recv-keys %s",
(gpgbin ? gpgbin : "gpg"), sig->fpr);
AlertValue val = G_ALERTDEFAULT;
}
}
+gchar *get_gpg_executable_name()
+{
+ gpgme_engine_info_t e;
+
+ if (!gpgme_get_engine_info(&e)) {
+ while (e != NULL) {
+ if (e->protocol == GPGME_PROTOCOL_OpenPGP
+ && e->file_name != NULL) {
+ debug_print("Found gpg executable: '%s'\n", e->file_name);
+ return e->file_name;
+ }
+ }
+ }
+
+ return NULL;
+}
+
static gchar *extract_name(const char *uid)
{
if (uid == NULL)
g_free(buf);
if (val == G_ALERTALTERNATE) {
#ifndef G_OS_WIN32
- gchar *cmd = g_strdup_printf("gpg --no-tty --send-keys %s", key->fpr);
+ gchar *gpgbin = get_gpg_executable_name();
+ gchar *cmd = g_strdup_printf("\"%s\" --no-tty --send-keys %s",
+ (gpgbin ? gpgbin : "gpg"), key->fpr);
int res = 0;
pid_t pid = 0;
pid = fork();
void *sgpgme_data_release_and_get_mem(gpgme_data_t data, size_t *len);
gpgme_error_t cm_gpgme_data_rewind(gpgme_data_t dh);
+gchar *get_gpg_executable_name();
#endif /* SGPGME_H */