[git] Pinentry - branch, master, updated. pinentry-0.9.7-30-gdb3b2bf

by Ineiev cvs at cvs.gnupg.org
Mon Oct 3 09:01:46 CEST 2016


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 standard pinentry collection".

The branch, master has been updated
       via  db3b2bf0c7ae4d3d0fbeecfe6a9a77ea4ed0f84e (commit)
       via  f0ae2986708614bce9070eec77309e838c403db7 (commit)
       via  aa969a09a1225f8fb683ba8d0c3ccc099dd8d1d3 (commit)
      from  4c5ae72d481ffd24ff93accee0b42e9b264285f2 (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 db3b2bf0c7ae4d3d0fbeecfe6a9a77ea4ed0f84e
Author: Ineiev <ineiev at gnu.org>
Date:   Fri Apr 8 15:33:05 2016 +0300

    tty: Provide default text for "notok".
    
    * tty/pinentry-tty.c (confirm): Provide default text for "notok".
    
    --
    
    gniibe changed the commit message.

diff --git a/tty/pinentry-tty.c b/tty/pinentry-tty.c
index a36c588..cef6947 100644
--- a/tty/pinentry-tty.c
+++ b/tty/pinentry-tty.c
@@ -211,7 +211,7 @@ confirm (pinentry_t pinentry, FILE *ttyfi, FILE *ttyfo)
 	cancel = button (pinentry->default_cancel, "Cancel", ttyfo);
 
       if (pinentry->notok)
-	notok = button (pinentry->notok, NULL, ttyfo);
+	notok = button (pinentry->notok, "No", ttyfo);
     }
 
   if (cbreak (fileno (ttyfi)) == -1)

commit f0ae2986708614bce9070eec77309e838c403db7
Author: Ineiev <ineiev at gnu.org>
Date:   Fri Apr 8 15:26:33 2016 +0300

    tty: Fix underscore processing in accelerators.
    
    * tty/pinentry-tty.c (button): Fix underscore processing in
    accelerators.

diff --git a/tty/pinentry-tty.c b/tty/pinentry-tty.c
index d36a667..a36c588 100644
--- a/tty/pinentry-tty.c
+++ b/tty/pinentry-tty.c
@@ -84,10 +84,15 @@ button (char *text, char *default_text, FILE *ttyfo)
     {
       highlight = highlight + 1;
       if (*highlight == '_')
-	/* Escaped underscore.  */
-	continue;
-      else
-	break;
+        {
+          /* Escaped underscore.  Skip both characters.  */
+          highlight++;
+          continue;
+        }
+      if (!isalnum (*highlight))
+        /* Unusable accelerator.  */
+        continue;
+      break;
     }
 
   if (! highlight)
@@ -98,8 +103,8 @@ button (char *text, char *default_text, FILE *ttyfo)
 	highlight ++;
     }
 
-  if (! highlight)
-    /* Hmm, no alpha-num characters.  */
+  if (! *highlight)
+    /* Hmm, no alpha-numeric characters.  */
     {
       if (! default_text)
 	return 0;
@@ -111,7 +116,11 @@ button (char *text, char *default_text, FILE *ttyfo)
     {
       /* Skip accelerator prefix.  */
       if (*text == '_')
-	continue;
+        {
+          text ++;
+          if (! *text)
+            break;
+        }
 
       if (text == highlight)
 	fputs (UNDERLINE_START, ttyfo);

commit aa969a09a1225f8fb683ba8d0c3ccc099dd8d1d3
Author: Ineiev <ineiev at gnu.org>
Date:   Fri Apr 8 15:17:59 2016 +0300

    tty: Refactor usage of tolower.
    
    * tty/pinentry-tty.c (button): Apply tolower to the result.
    * tty/pinentry-tty.c (confirm): Compare lowercased character instead of
    converting them every time.
    
    --
    
    gniibe changed the original patch to keep output to TTY.

diff --git a/tty/pinentry-tty.c b/tty/pinentry-tty.c
index 4e71edf..d36a667 100644
--- a/tty/pinentry-tty.c
+++ b/tty/pinentry-tty.c
@@ -121,7 +121,7 @@ button (char *text, char *default_text, FILE *ttyfo)
     }
   fputc ('\n', ttyfo);
 
-  return *highlight;
+  return tolower (*highlight);
 }
 
 static void
@@ -223,17 +223,18 @@ confirm (pinentry_t pinentry, FILE *ttyfi, FILE *ttyfo)
         {
           fputc ('[', ttyfo);
           if (ok)
-            fputc (tolower (ok), ttyfo);
+            fputc (ok, ttyfo);
           if (cancel)
-            fputc (tolower (cancel), ttyfo);
+            fputc (cancel, ttyfo);
           if (notok)
-            fputc (tolower (notok), ttyfo);
+            fputc (notok, ttyfo);
           fputs("]? ", ttyfo);
         }
       fflush (ttyfo);
 
       input = fgetc (ttyfi);
       fprintf (ttyfo, "%c\n", input);
+      input = tolower (input);
 
       if (input == EOF || input == 0x4)
 	/* End of file or control-d (= end of file).  */
@@ -251,18 +252,18 @@ confirm (pinentry_t pinentry, FILE *ttyfi, FILE *ttyfo)
 	  break;
 	}
 
-      if (cancel && (input == toupper (cancel) || input == tolower (cancel)))
+      if (cancel && input == cancel)
 	{
 	  pinentry->canceled = 1;
 	  ret = 0;
 	  break;
 	}
-      else if (notok && (input == toupper (notok) || input == tolower (notok)))
+      else if (notok && input == notok)
 	{
 	  ret = 0;
 	  break;
 	}
-      else if (ok && (input == toupper (ok) || input == tolower (ok)))
+      else if (ok && input == ok)
 	{
 	  ret = 1;
 	  break;

-----------------------------------------------------------------------

Summary of changes:
 tty/pinentry-tty.c | 40 +++++++++++++++++++++++++---------------
 1 file changed, 25 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
The standard pinentry collection
http://git.gnupg.org




More information about the Gnupg-commits mailing list