From ae850b1ac755f471beac4dbfef4654fe3fbaaae9 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 9 Jan 2024 22:04:24 +0100 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libpatch_check_file.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 libpatch_check_file.c (limited to 'libpatch_check_file.c') 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; +} -- cgit v1.2.3-70-g09d2