mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* certdump.c (print_dn_part): Always print a leading slash,
removed NEED_DELIM arg and changed caller. * export.c (gpgsm_export): Print LFs to FP and not stdout. (print_short_info): Ditto. Make use of gpgsm_print_name. * server.c (cmd_export): Use output-fd instead of data lines; this was actually the specified way.
This commit is contained in:
parent
640688c4e2
commit
5c5a3f689a
5 changed files with 53 additions and 49 deletions
|
@ -364,9 +364,8 @@ parse_dn (const unsigned char *string)
|
|||
}
|
||||
|
||||
|
||||
static int
|
||||
print_dn_part (FILE *fp, struct dn_array_s *dn, const char *key,
|
||||
int need_delim)
|
||||
static void
|
||||
print_dn_part (FILE *fp, struct dn_array_s *dn, const char *key)
|
||||
{
|
||||
int any = 0;
|
||||
|
||||
|
@ -374,11 +373,7 @@ print_dn_part (FILE *fp, struct dn_array_s *dn, const char *key,
|
|||
{
|
||||
if (!strcmp (dn->key, key) && dn->value && *dn->value)
|
||||
{
|
||||
if (need_delim)
|
||||
{
|
||||
putc ('/', fp);
|
||||
need_delim = 0;
|
||||
}
|
||||
putc ('/', fp);
|
||||
if (any)
|
||||
fputs (" + ", fp);
|
||||
else
|
||||
|
@ -387,7 +382,6 @@ print_dn_part (FILE *fp, struct dn_array_s *dn, const char *key,
|
|||
any = 1;
|
||||
}
|
||||
}
|
||||
return any;
|
||||
}
|
||||
|
||||
/* Print all parts of a DN in a "standard" sequence. We first print
|
||||
|
@ -398,13 +392,10 @@ print_dn_parts (FILE *fp, struct dn_array_s *dn)
|
|||
const char *stdpart[] = {
|
||||
"CN", "OU", "O", "STREET", "L", "ST", "C", "EMail", NULL
|
||||
};
|
||||
int any=0, i;
|
||||
int i;
|
||||
|
||||
for (i=0; stdpart[i]; i++)
|
||||
{
|
||||
if (print_dn_part (fp, dn, stdpart[i], any))
|
||||
any = 1;
|
||||
}
|
||||
print_dn_part (fp, dn, stdpart[i]);
|
||||
|
||||
/* now print the rest without any specific ordering */
|
||||
for (; dn->key; dn++)
|
||||
|
@ -415,10 +406,7 @@ print_dn_parts (FILE *fp, struct dn_array_s *dn)
|
|||
break;
|
||||
}
|
||||
if (!stdpart[i])
|
||||
{
|
||||
if (print_dn_part (fp, dn, dn->key, any))
|
||||
any = 1;
|
||||
}
|
||||
print_dn_part (fp, dn, dn->key);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue