Function: majutsu-conflict--strip-one-ending-eol

majutsu-conflict--strip-one-ending-eol is a natively compiled function defined in majutsu-conflict.el.

Signature

(majutsu-conflict--strip-one-ending-eol CONTENT)

Documentation

Strip one trailing line ending from CONTENT.

If CONTENT ends with LF, drop it. If it ends with CRLF, drop both.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-conflict.el
(defun majutsu-conflict--strip-one-ending-eol (content)
  "Strip one trailing line ending from CONTENT.
If CONTENT ends with LF, drop it. If it ends with CRLF, drop both."
  (if (and (stringp content)
           (> (length content) 0)
           (eq (aref content (1- (length content))) ?\n))
      (let ((without-lf (substring content 0 -1)))
        (if (and (> (length without-lf) 0)
                 (eq (aref without-lf (1- (length without-lf))) ?\r))
            (substring without-lf 0 -1)
          without-lf))
    content))