mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +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);
|
||||
|
||||
if (!nfiles)
|
||||
rc = import_one (ctrl, &stats, es_stdin);
|
||||
{
|
||||
#ifdef HAVE_DOSISH_SYSTEM
|
||||
setmode (0, O_BINARY);
|
||||
#endif
|
||||
rc = import_one (ctrl, &stats, es_stdin);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (; nfiles && !rc ; nfiles--, files++)
|
||||
{
|
||||
estream_t fp = of (*files, "r");
|
||||
estream_t fp = of (*files, "rb");
|
||||
rc = import_one (ctrl, &stats, fp);
|
||||
es_fclose (fp);
|
||||
if (rc == -1/* legacy*/ || gpg_err_code (rc) == GPG_ERR_NOT_FOUND)
|
||||
|
Loading…
x
Reference in New Issue
Block a user