"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
fix typo in got_ferror() call
To:
Game of Trees <gameoftrees@openbsd.org>
Date:
Tue, 10 Jan 2023 23:34:15 +1100

Download raw body.

Thread
As per the subject line, looks like a copypasta or typo: we want to
check the error indicator on rejectfile--not outfile.

diff /home/mark/src/got
commit - 649fd5defd632367fed37d7b10e9ab6df8c7eb73
path + /home/mark/src/got
blob - 76e39597d9c660a39120119d1f5538a0f5baf8ce
file + lib/worktree.c
--- lib/worktree.c
+++ lib/worktree.c
@@ -4255,7 +4255,7 @@ copy_one_line(FILE *infile, FILE *outfile, FILE *rejec
        if (rejectfile) {
                n = fwrite(line, 1, linelen, rejectfile);
                if (n != linelen)
-                       err = got_ferror(outfile, GOT_ERR_IO);
+                       err = got_ferror(rejectfile, GOT_ERR_IO);
        }
 done:
        free(line);

-- 
Mark Jamsek <fnc.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68