[PR #14901] fix: correctly count CRLF line endings in modelfile parser #46154

Open
opened 2026-04-25 01:40:41 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14901
Author: @LincolnBurrows2017
Created: 3/17/2026
Status: 🔄 Open

Base: mainHead: fix/windows-line-ending-count


📝 Commits (1)

  • a4b547d fix: correctly count CRLF line endings in modelfile parser

📊 Changes

1 file changed (+3 additions, -1 deletions)

View changed files

📝 parser/parser.go (+3 -1)

📄 Description

The parser was incorrectly counting Windows-style line endings (CRLF) as two separate lines, causing incorrect line numbers in error messages. This fix tracks the previous character and only increments the line counter when encountering a newline that is not part of a CRLF sequence.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14901 **Author:** [@LincolnBurrows2017](https://github.com/LincolnBurrows2017) **Created:** 3/17/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/windows-line-ending-count` --- ### 📝 Commits (1) - [`a4b547d`](https://github.com/ollama/ollama/commit/a4b547df4f8394b2e81a09525ebebb97a14ff179) fix: correctly count CRLF line endings in modelfile parser ### 📊 Changes **1 file changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `parser/parser.go` (+3 -1) </details> ### 📄 Description The parser was incorrectly counting Windows-style line endings (CRLF) as two separate lines, causing incorrect line numbers in error messages. This fix tracks the previous character and only increments the line counter when encountering a newline that is not part of a CRLF sequence. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 01:40:41 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#46154