* keylist.c (reorder_keyblock, do_reorder_keyblock): Reorder attribute
authorDavid Shaw <dshaw@jabberwocky.com>
Tue, 20 Sep 2005 03:34:32 +0000 (03:34 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Tue, 20 Sep 2005 03:34:32 +0000 (03:34 +0000)
IDs as well as regular text IDs.

* plaintext.c (ask_for_detached_datafile): Use make_filename() on
filename so tilde expansion works.

g10/ChangeLog
g10/keylist.c
g10/plaintext.c

index 57134e6..bea12da 100644 (file)
@@ -1,3 +1,11 @@
+2005-09-19  David Shaw  <dshaw@jabberwocky.com>
+
+       * keylist.c (reorder_keyblock, do_reorder_keyblock): Reorder
+       attribute IDs as well as regular text IDs.
+
+       * plaintext.c (ask_for_detached_datafile): Use make_filename() on
+       filename so tilde expansion works.
+
 2005-09-14  David Shaw  <dshaw@jabberwocky.com>
 
        * main.h, misc.c (parse_options): Add the ability to have help
index b5ba537..610a839 100644 (file)
@@ -1379,15 +1379,16 @@ list_keyblock_colon( KBNODE keyblock, int secret, int fpr )
  * Reorder the keyblock so that the primary user ID (and not attribute
  * packet) comes first.  Fixme: Replace this by a generic sort
  * function.  */
-void
-reorder_keyblock (KBNODE keyblock)
+static void
+do_reorder_keyblock (KBNODE keyblock,int attr)
 {
     KBNODE primary = NULL, primary0 = NULL, primary2 = NULL;
     KBNODE last, node;
 
     for (node=keyblock; node; primary0=node, node = node->next) {
        if( node->pkt->pkttype == PKT_USER_ID &&
-           !node->pkt->pkt.user_id->attrib_data &&
+           ((attr && node->pkt->pkt.user_id->attrib_data) ||
+            (!attr && !node->pkt->pkt.user_id->attrib_data)) &&
             node->pkt->pkt.user_id->is_primary ) {
             primary = primary2 = node;
             for (node=node->next; node; primary2=node, node = node->next ) {
@@ -1419,6 +1420,13 @@ reorder_keyblock (KBNODE keyblock)
 }
 
 void
+reorder_keyblock (KBNODE keyblock)
+{
+  do_reorder_keyblock(keyblock,1);
+  do_reorder_keyblock(keyblock,0);
+}
+
+void
 list_keyblock( KBNODE keyblock, int secret, int fpr, void *opaque )
 {
     reorder_keyblock (keyblock);
index e3ea369..dec3b53 100644 (file)
@@ -446,12 +446,16 @@ ask_for_detached_datafile( MD_HANDLE md, MD_HANDLE md2,
        int any=0;
        tty_printf(_("Detached signature.\n"));
        do {
+           char *name;
            xfree(answer);
            tty_enable_completion(NULL);
-           answer = cpr_get("detached_signature.filename",
+           name = cpr_get("detached_signature.filename",
                           _("Please enter name of data file: "));
            tty_disable_completion();
            cpr_kill_prompt();
+           answer=make_filename(name,(void *)NULL);
+           xfree(name);
+
            if( any && !*answer ) {
                rc = G10ERR_READ_FILE;
                goto leave;