aboutsummaryrefslogtreecommitdiffstats
path: root/libpatch_check_file.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libpatch_check_file.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libpatch_check_file.c b/libpatch_check_file.c
new file mode 100644
index 0000000..4f0adca
--- /dev/null
+++ b/libpatch_check_file.c
@@ -0,0 +1,15 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+int
+libpatch_check_file(struct libpatch_file *file, enum libpatch_style style, int multifile)
+{
+ int req = libpatch_style_requires_text(style, multifile);
+ if (req > 0) {
+ if (req & LIBPATCH_STYLE_REQUIRES_LF_TERMINATION)
+ if (file->lf_terminated)
+ req ^= LIBPATCH_STYLE_REQUIRES_LF_TERMINATION;
+ }
+ return req;
+}