From 0f22a35cecdaf83b8fca3cdfb5c45feb6f5e292c Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Tue, 18 Sep 2012 00:24:49 +0200 Subject: Rename get_input_file() parameter to clarify code * src/inp.c (get_input_file): Rename mode parameter to file_type, it's all we care about here. --- src/inp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/inp.c b/src/inp.c index 7b80d71..5a42e75 100644 --- a/src/inp.c +++ b/src/inp.c @@ -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; -- cgit v1.2.1