mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-03 12:11:33 +01:00
sm: Fix handling of importing in binary mode.
* sm/import.c (gpgsm_import_files): Fix handling of binary mode. -- GnuPG-bug-id: 6592 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
635a7fef4d
commit
b4246422f4
@ -524,12 +524,17 @@ gpgsm_import_files (ctrl_t ctrl, int nfiles, char **files,
|
|||||||
memset (&stats, 0, sizeof stats);
|
memset (&stats, 0, sizeof stats);
|
||||||
|
|
||||||
if (!nfiles)
|
if (!nfiles)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_DOSISH_SYSTEM
|
||||||
|
setmode (0, O_BINARY);
|
||||||
|
#endif
|
||||||
rc = import_one (ctrl, &stats, es_stdin);
|
rc = import_one (ctrl, &stats, es_stdin);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (; nfiles && !rc ; nfiles--, files++)
|
for (; nfiles && !rc ; nfiles--, files++)
|
||||||
{
|
{
|
||||||
estream_t fp = of (*files, "r");
|
estream_t fp = of (*files, "rb");
|
||||||
rc = import_one (ctrl, &stats, fp);
|
rc = import_one (ctrl, &stats, fp);
|
||||||
es_fclose (fp);
|
es_fclose (fp);
|
||||||
if (rc == -1/* legacy*/ || gpg_err_code (rc) == GPG_ERR_NOT_FOUND)
|
if (rc == -1/* legacy*/ || gpg_err_code (rc) == GPG_ERR_NOT_FOUND)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user