[PR #14924] fix: correctly count CRLF line endings in modelfile parser #61619

Open
opened 2026-04-29 16:41:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14924
Author: @Jah-yee
Created: 3/18/2026
Status: 🔄 Open

Base: mainHead: fix/crlf-line-counting


📝 Commits (2)

  • c8fbaa9 fix(app): remove sidebar open animation on initial load
  • b0a68c1 fix: correctly count CRLF line endings in modelfile parser

📊 Changes

2 files changed (+17 additions, -5 deletions)

View changed files

📝 app/ui/app/src/components/layout/layout.tsx (+14 -4)
📝 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.

Fixes #14901


🔄 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/14924 **Author:** [@Jah-yee](https://github.com/Jah-yee) **Created:** 3/18/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/crlf-line-counting` --- ### 📝 Commits (2) - [`c8fbaa9`](https://github.com/ollama/ollama/commit/c8fbaa9e5be988741138b0eeda781df56e5181f4) fix(app): remove sidebar open animation on initial load - [`b0a68c1`](https://github.com/ollama/ollama/commit/b0a68c11dec1068174d9b6e8b6ce659300bdd5d0) fix: correctly count CRLF line endings in modelfile parser ### 📊 Changes **2 files changed** (+17 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `app/ui/app/src/components/layout/layout.tsx` (+14 -4) 📝 `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. Fixes #14901 --- <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-29 16:41:09 -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#61619