diff options
-rw-r--r-- | src/inp.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -130,7 +130,7 @@ too_many_lines (char const *filename) bool -get_input_file (char const *filename, char const *outname, mode_t mode) +get_input_file (char const *filename, char const *outname, mode_t file_type) { bool elsewhere = strcmp (filename, outname) != 0; char const *cs; @@ -141,7 +141,7 @@ get_input_file (char const *filename, char const *outname, mode_t mode) inerrno = lstat (filename, &instat) == 0 ? 0 : errno; /* Perhaps look for RCS or SCCS versions. */ - if (S_ISREG (mode) + if (S_ISREG (file_type) && patch_get && invc != 0 && (inerrno @@ -195,12 +195,12 @@ get_input_file (char const *filename, char const *outname, mode_t mode) instat.st_mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH; instat.st_size = 0; } - else if (! ((S_ISREG (mode) || S_ISLNK (mode)) - && (mode & S_IFMT) == (instat.st_mode & S_IFMT))) + else if (! ((S_ISREG (file_type) || S_ISLNK (file_type)) + && (file_type & S_IFMT) == (instat.st_mode & S_IFMT))) { say ("File %s is not a %s -- refusing to patch\n", quotearg (filename), - S_ISLNK (mode) ? "symbolic link" : "regular file"); + S_ISLNK (file_type) ? "symbolic link" : "regular file"); return false; } return true; |