[git] GPA - branch, master, updated. gpa-0.9.10-17-g48a685e
by Werner Koch
cvs at cvs.gnupg.org
Tue Jun 5 20:26:02 CEST 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Assistant".
The branch, master has been updated
via 48a685eec1940f1b325da99040cc532aa66be191 (commit)
via 85baf24947e4d05a116bd59c08cf198909a85fad (commit)
via a5db9c242b8789413e703f70b3b5d5029b6956ed (commit)
via fa562297a5aeb0e804211703af5622af6036999b (commit)
from 069e354d8265ef0071522b14df981281e78a6409 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 48a685eec1940f1b325da99040cc532aa66be191
Author: Werner Koch <wk at gnupg.org>
Date: Tue Jun 5 20:17:18 2018 +0200
Simplify a xmalloc+snprintf use.
* src/confdialog.c (create_dialog_tabs_2): Use g_strdup_printf.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/src/confdialog.c b/src/confdialog.c
index 54bffdf..35ac05e 100644
--- a/src/confdialog.c
+++ b/src/confdialog.c
@@ -1018,7 +1018,6 @@ create_dialog_tabs_2 (gpgme_conf_comp_t old_conf, gpgme_conf_comp_t new_conf)
if (option->flags & GPGME_CONF_GROUP)
{
char *name;
- size_t name_len;
const char *title;
if (! group_has_options (option, &option))
@@ -1036,12 +1035,8 @@ create_dialog_tabs_2 (gpgme_conf_comp_t old_conf, gpgme_conf_comp_t new_conf)
instantly privide that. */
title = (option->argname && *option->argname)?
option->argname : option->description;
- name_len = strlen (title) + strlen("<b></b>") + 1;
- name = xmalloc (name_len);
- snprintf (name, name_len, "<b>%s</b>", title);
- name[name_len - 1] = '\0';
+ name = g_strdup_printf ("<b>%s</b>", title);
percent_unescape (name, 0);
-
label = gtk_label_new (name);
xfree (name);
commit 85baf24947e4d05a116bd59c08cf198909a85fad
Author: Ineiev <ineiev at gnu.org>
Date: Tue May 22 09:39:02 2018 +0000
Unescape description texts.
* src/confdialog.c (create_dialog_tabs_2): Strdup and unescape
option->description and comp->description before using as labels.
--
When not unescaped, commas in description texts show up like %2C.
Signed-off-by: Ineiev <ineiev at gnu.org>
diff --git a/src/confdialog.c b/src/confdialog.c
index 0356b03..54bffdf 100644
--- a/src/confdialog.c
+++ b/src/confdialog.c
@@ -971,12 +971,16 @@ create_dialog_tabs_2 (gpgme_conf_comp_t old_conf, gpgme_conf_comp_t new_conf)
if (reset)
{
+ char *description;
/* FIXME: Might need to put pages into scrolled panes if
there are too many. */
page = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (dialog_notebook), page);
- label = gtk_label_new (comp->description);
+ description = xstrdup (comp->description);
+ percent_unescape (description, 0);
+ label = gtk_label_new (description);
+ xfree (description);
gtk_notebook_set_tab_label
(GTK_NOTEBOOK (dialog_notebook),
gtk_notebook_get_nth_page (GTK_NOTEBOOK (dialog_notebook),
@@ -1036,6 +1040,8 @@ create_dialog_tabs_2 (gpgme_conf_comp_t old_conf, gpgme_conf_comp_t new_conf)
name = xmalloc (name_len);
snprintf (name, name_len, "<b>%s</b>", title);
name[name_len - 1] = '\0';
+ percent_unescape (name, 0);
+
label = gtk_label_new (name);
xfree (name);
@@ -1198,7 +1204,13 @@ create_dialog_tabs_2 (gpgme_conf_comp_t old_conf, gpgme_conf_comp_t new_conf)
#if GTK_CHECK_VERSION (2, 12, 0)
/* Add a tooltip description. */
if (option->description)
- gtk_widget_set_tooltip_text (vbox, option->description);
+ {
+ char *description = xstrdup (option->description);
+
+ percent_unescape (description, 0);
+ gtk_widget_set_tooltip_text (vbox, description);
+ xfree (description);
+ }
#endif
}
option = option->next;
commit a5db9c242b8789413e703f70b3b5d5029b6956ed
Author: Ineiev <ineiev at gnu.org>
Date: Tue May 22 08:28:10 2018 +0000
Fix percent unescaping.
* src/utils.c (percent_unescape): Fix output string length.
--
Without *p = 0, the function produces wrong results
for any strings with escapes, for example:
"%55" -> "U55" (should be "U")
Signed-off-by: Ineiev <ineiev at gnu.org>
diff --git a/src/utils.c b/src/utils.c
index 0d3379f..e80b251 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -340,6 +340,7 @@ percent_unescape (char *string, int plus2space)
n++;
}
}
+ *p = 0;
return n;
}
commit fa562297a5aeb0e804211703af5622af6036999b
Author: Ineiev <ineiev at gnu.org>
Date: Tue May 22 09:16:10 2018 +0000
Eliminate arbitrary length limit on labels.
* src/confdialog.c (create_dialog_tabs_2): Allocate memory
for labels with xmalloc.
--
The previous limit of 79 characters means 39 letters or less
for non-Latin scripts, which is too short for some languages.
Signed-off-by: Ineiev <ineiev at gnu.org>
diff --git a/src/confdialog.c b/src/confdialog.c
index 74ced87..0356b03 100644
--- a/src/confdialog.c
+++ b/src/confdialog.c
@@ -34,6 +34,7 @@
#include "gpgmetools.h"
#include "gtktools.h"
#include "options.h"
+#include "gpa.h"
/* Violation of GNOME standards: Cancel does not revert previous
apply. We do not auto-apply or syntax check after focus
@@ -1012,7 +1013,9 @@ create_dialog_tabs_2 (gpgme_conf_comp_t old_conf, gpgme_conf_comp_t new_conf)
{
if (option->flags & GPGME_CONF_GROUP)
{
- char name[80];
+ char *name;
+ size_t name_len;
+ const char *title;
if (! group_has_options (option, &option))
continue;
@@ -1027,11 +1030,14 @@ create_dialog_tabs_2 (gpgme_conf_comp_t old_conf, gpgme_conf_comp_t new_conf)
used for it. AFAICS, we would only need to prefix
the description with the group name and gpgconf would
instantly privide that. */
- snprintf (name, sizeof (name), "<b>%s</b>",
- (option->argname && *option->argname)?
- option->argname : option->description);
- name[sizeof (name) - 1] = '\0';
+ title = (option->argname && *option->argname)?
+ option->argname : option->description;
+ name_len = strlen (title) + strlen("<b></b>") + 1;
+ name = xmalloc (name_len);
+ snprintf (name, name_len, "<b>%s</b>", title);
+ name[name_len - 1] = '\0';
label = gtk_label_new (name);
+ xfree (name);
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_frame_set_label_widget (GTK_FRAME (frame), label);
-----------------------------------------------------------------------
Summary of changes:
src/confdialog.c | 27 ++++++++++++++++++++-------
src/utils.c | 1 +
2 files changed, 21 insertions(+), 7 deletions(-)
hooks/post-receive
--
The GNU Privacy Assistant
http://git.gnupg.org
More information about the Gnupg-commits
mailing list