From 335d393062e49f3dcbfc2ccaf34e459ad98cd7c2 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Wed, 21 Jan 2004 04:21:29 +0000 Subject: [PATCH] * g10.c (list_config): Add "version" tag for --list-config. --- g10/ChangeLog | 4 ++++ g10/g10.c | 55 +++++++++++++++++++++++++++++---------------------- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 8b1a24724..cf00a1e6b 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,7 @@ +2004-01-20 David Shaw + + * g10.c (list_config): Add "version" tag for --list-config. + 2004-01-15 David Shaw * g10.c (collapse_args): New function to turn argc/argv into a diff --git a/g10/g10.c b/g10/g10.c index 7ba0c098a..66eb4c600 100644 --- a/g10/g10.c +++ b/g10/g10.c @@ -1091,13 +1091,43 @@ static void list_config(char *items) { int show_all=(items==NULL); - char *name; + char *name=NULL; if(!opt.with_colons) return; while(show_all || (name=strsep(&items," "))) { + if(show_all || ascii_strcasecmp(name,"group")==0) + { + struct groupitem *iter; + + for(iter=opt.grouplist;iter;iter=iter->next) + { + STRLIST sl; + + printf("cfg:group:"); + print_string(stdout,iter->name,strlen(iter->name),':'); + printf(":"); + + for(sl=iter->values;sl;sl=sl->next) + { + print_string2(stdout,sl->d,strlen(sl->d),':',';'); + if(sl->next) + printf(";"); + } + + printf("\n"); + } + } + + if(show_all || ascii_strcasecmp(name,"version")==0) + { + printf("cfg:version:"); + print_string(stdout,VERSION,strlen(VERSION),':'); + printf("\n"); + } + if(show_all || ascii_strcasecmp(name,"pubkey")==0) { printf("cfg:pubkey:"); @@ -1128,29 +1158,6 @@ list_config(char *items) printf("\n"); } - if(show_all || ascii_strcasecmp(name,"group")==0) - { - struct groupitem *iter; - - for(iter=opt.grouplist;iter;iter=iter->next) - { - STRLIST sl; - - printf("cfg:group:"); - print_string(stdout,iter->name,strlen(iter->name),':'); - printf(":"); - - for(sl=iter->values;sl;sl=sl->next) - { - print_string2(stdout,sl->d,strlen(sl->d),':',';'); - if(sl->next) - printf(";"); - } - - printf("\n"); - } - } - if(show_all) break; }