diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/pch.c | 4 |
2 files changed, 6 insertions, 1 deletions
@@ -1,5 +1,8 @@ 2009-04-26 Andreas Gruenbacher <agruen@suse.de> + * src/pch.c (intuit_diff_type): Only check for reversed patches when + the input file is patchable in the first place. + * src/pch.c (get_input_file): If an input file is not a regular file, only skip the patch instead of aborting. * src/patch.c (main): If get_input_file() fails, skip the patch. @@ -713,6 +713,7 @@ intuit_diff_type (bool need_header) } if (i0 != NONE + && (i == NONE || S_ISREG (st[i].st_mode)) && maybe_reverse (p_name[i0], i == NONE, i == NONE || st[i].st_size == 0)) i = i0; @@ -747,7 +748,8 @@ intuit_diff_type (bool need_header) if (inname) { inerrno = stat (inname, &instat) == 0 ? 0 : errno; - maybe_reverse (inname, inerrno, inerrno || instat.st_size == 0); + if (inerrno || S_ISREG (instat.st_mode)) + maybe_reverse (inname, inerrno, inerrno || instat.st_size == 0); } else inerrno = -1; |