+ if (password_list)
+ {
+ FILE *password_file;
+ if (!strcmp (password_list, "-"))
+ password_file = stdin;
+ else
+ {
+ password_file = fopen (password_list, "r");
+ if (!password_file)
+ error (1, errno, _("%s: error opening password file"),
+ password_list);
+ }
+
+ struct string pw = DS_EMPTY_INITIALIZER;
+ unsigned int target = 100000;
+ for (unsigned int i = 0; ; i++)
+ {
+ ds_clear (&pw);
+ if (!ds_read_line (&pw, password_file, SIZE_MAX))
+ {
+ if (isatty (STDOUT_FILENO))
+ {
+ putchar ('\r');
+ fflush (stdout);
+ }
+ error (1, 0, _("\n%s: password not in file"), password_list);
+ }
+ ds_chomp_byte (&pw, '\n');
+
+ if (i >= target)
+ {
+ target += 100000;
+ if (isatty (STDOUT_FILENO))
+ {
+ printf ("\r%u", i);
+ fflush (stdout);
+ }
+ }
+
+ if (encrypted_file_unlock__ (enc, ds_cstr (&pw)))
+ {
+ printf ("\npassword is: \"%s\"\n", ds_cstr (&pw));
+ password = ds_cstr (&pw);
+ break;
+ }
+ }
+ }
+ else if (alphabet[0] && max_length)