Used to say just "could not read password from file "...": Success", which
isn't very informative.
Mats Erik Andersson. Backpatch to all supported versions.
}
if (!fgets(pwdbuf, sizeof(pwdbuf), pwf))
{
- fprintf(stderr, _("%s: could not read password from file \"%s\": %s\n"),
- progname, pwfilename, strerror(errno));
+ if (ferror(pwf))
+ fprintf(stderr, _("%s: could not read password from file \"%s\": %s\n"),
+ progname, pwfilename, strerror(errno));
+ else
+ fprintf(stderr, _("%s: password file \"%s\" is empty\n"),
+ progname, pwfilename);
exit_nicely();
}
fclose(pwf);