iindex: read until the first newline or CR or TAB - stagit-gopher - A git gopher frontend. (mirror) Err bitreich.org 70 hgit clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ URL:git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ bitreich.org 70 1Log /scm/stagit-gopher/log.gph bitreich.org 70 1Files /scm/stagit-gopher/files.gph bitreich.org 70 1Refs /scm/stagit-gopher/refs.gph bitreich.org 70 1Tags /scm/stagit-gopher/tag bitreich.org 70 1README /scm/stagit-gopher/file/README.gph bitreich.org 70 1LICENSE /scm/stagit-gopher/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit 203a8500a5017ff2bfb77ccdbd33938c1ad4fea1 /scm/stagit-gopher/commit/203a8500a5017ff2bfb77ccdbd33938c1ad4fea1.gph bitreich.org 70 1parent 45274ebb4ba07c9771c279aae51259040d94d0ab /scm/stagit-gopher/commit/45274ebb4ba07c9771c279aae51259040d94d0ab.gph bitreich.org 70 hAuthor: Hiltjo Posthuma URL:mailto:hiltjo@codemadness.org bitreich.org 70 iDate: Sat, 25 Nov 2017 15:13:40 +0100 Err bitreich.org 70 i Err bitreich.org 70 iindex: read until the first newline or CR or TAB Err bitreich.org 70 i Err bitreich.org 70 iThis makes sure the column is properly aligned also, because a newline is Err bitreich.org 70 iignored, but it is counted in utf8pad(). Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M stagit-gopher-index.c | 4 +++- Err bitreich.org 70 i Err bitreich.org 70 i1 file changed, 3 insertions(+), 1 deletion(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/stagit-gopher-index.c b/stagit-gopher-index.c /scm/stagit-gopher/file/stagit-gopher-index.c.gph bitreich.org 70 i@@ -264,7 +264,9 @@ main(int argc, char *argv[]) Err bitreich.org 70 i } Err bitreich.org 70 i description[0] = '\0'; Err bitreich.org 70 i if (fp) { Err bitreich.org 70 i- if (!fgets(description, sizeof(description), fp)) Err bitreich.org 70 i+ if (fgets(description, sizeof(description), fp)) Err bitreich.org 70 i+ description[strcspn(description, "\t\r\n")] = '\0'; Err bitreich.org 70 i+ else Err bitreich.org 70 i description[0] = '\0'; Err bitreich.org 70 i fclose(fp); Err bitreich.org 70 i } Err bitreich.org 70 .