diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b6cb29..d469281 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: jobs: freebsd13: name: FreeBSD - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 steps: - uses: vmactions/freebsd-vm@7ca82f79fe3078fecded6d3a2bff094995447bbd with: @@ -20,7 +20,7 @@ jobs: set -u set -x uname -rms - pkg install -y cmake git python3 py311-pytest vim + pkg install -y cmake git python3 devel/py-pytest vim python3 --version git clone --no-checkout -- ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} wd cd wd @@ -36,7 +36,7 @@ jobs: linux: name: Linux - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 env: DEBIAN_FRONTEND: noninteractive CFLAGS: -Werror -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=address,undefined @@ -56,7 +56,7 @@ jobs: linux_shared: name: Linux, shared libraries - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 env: DEBIAN_FRONTEND: noninteractive CFLAGS: -Werror -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=address,undefined @@ -76,7 +76,7 @@ jobs: linux_release: name: Linux, release build - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 env: DEBIAN_FRONTEND: noninteractive CFLAGS: -Werror -g -fno-omit-frame-pointer -fsanitize=address,undefined -fno-sanitize-recover=address,undefined @@ -124,7 +124,7 @@ jobs: c_analysis: name: C analysis - runs-on: ubuntu-24.04 + runs-on: ubuntu-26.04 steps: - run: uname -rms - run: python3 --version @@ -141,7 +141,7 @@ jobs: py_format: name: Python format - runs-on: ubuntu-22.04 + runs-on: ubuntu-26.04 env: DEBIAN_FRONTEND: noninteractive steps: diff --git a/libvimcat/src/read.c b/libvimcat/src/read.c index d364ec9..0ac0c8a 100644 --- a/libvimcat/src/read.c +++ b/libvimcat/src/read.c @@ -103,7 +103,10 @@ static int get_extent(const char *filename, size_t limit, size_t *rows, // is this a Windows end of line? if (c == '\r') { int n = getc(f); - if (n == '\n') { + if (n == EOF) { + ++width; + break; + } else if (n == '\n') { ++lines; if (max_width < width) max_width = width; @@ -111,11 +114,9 @@ static int get_extent(const char *filename, size_t limit, size_t *rows, continue; } - if (n != EOF) { - if (ERROR(ungetc(n, f) == EOF)) { - rc = EIO; - goto done; - } + if (ERROR(ungetc(n, f) == EOF)) { + rc = EIO; + goto done; } }