mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Cleanups to extr.c and pdfattach
1. In extr.c the error message should use the correct full pathname, not the base filename. 2. In pdfattach the check for existence of input files should be replaced with the check for read access to them.
This commit is contained in:
committed by
Qingping Hou
parent
9348b5c553
commit
8245017078
2
extr.c
2
extr.c
@@ -59,7 +59,7 @@ int save_attachments(int pageno, char *targetdir)
|
||||
sprintf(pathname, "%s/%s", targetdir, name);
|
||||
FILE *fout = fopen(pathname, "w");
|
||||
if (!fout) {
|
||||
fprintf(stderr, "extr: cannot write to file %s\n", name);
|
||||
fprintf(stderr, "extr: cannot write to file %s\n", pathname);
|
||||
exit(1);
|
||||
}
|
||||
dump_stream(pdf_to_num(f_obj), fout);
|
||||
|
||||
@@ -67,7 +67,7 @@ numargs=$#
|
||||
for ((i=1 ; i <= $numargs ; i++))
|
||||
do
|
||||
fullname=$(readlink -f "$1")
|
||||
if [ ! -f "$fullname" ] ; then
|
||||
if [ ! -r "$fullname" ] ; then
|
||||
echo "$progname: file \"$fullname\" does not exist" >&2
|
||||
usage
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user