iuse LEN() macros for arrays - 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 ee1e685d9d6391f5eba3c539462c76623d5b50de /scm/stagit-gopher/commit/ee1e685d9d6391f5eba3c539462c76623d5b50de.gph bitreich.org 70 1parent 12facdbeb1a1c012d16bca8cd8d77b04ee8d10ae /scm/stagit-gopher/commit/12facdbeb1a1c012d16bca8cd8d77b04ee8d10ae.gph bitreich.org 70 hAuthor: Hiltjo Posthuma URL:mailto:hiltjo@codemadness.org bitreich.org 70 iDate: Sun, 15 Nov 2020 21:21:39 +0100 Err bitreich.org 70 i Err bitreich.org 70 iuse LEN() macros for arrays Err bitreich.org 70 i Err bitreich.org 70 ifrom Augustin Fabre Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M stagit-gopher.c | 6 ++++-- Err bitreich.org 70 i Err bitreich.org 70 i1 file changed, 4 insertions(+), 2 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/stagit-gopher.c b/stagit-gopher.c /scm/stagit-gopher/file/stagit-gopher.c.gph bitreich.org 70 i@@ -18,6 +18,8 @@ Err bitreich.org 70 i Err bitreich.org 70 i #include "compat.h" Err bitreich.org 70 i Err bitreich.org 70 i+#define LEN(s) (sizeof(s)/sizeof(*s)) Err bitreich.org 70 i+ Err bitreich.org 70 i struct deltainfo { Err bitreich.org 70 i git_patch *patch; Err bitreich.org 70 i Err bitreich.org 70 i@@ -1314,7 +1316,7 @@ main(int argc, char *argv[]) Err bitreich.org 70 i } Err bitreich.org 70 i Err bitreich.org 70 i /* check LICENSE */ Err bitreich.org 70 i- for (i = 0; i < sizeof(licensefiles) / sizeof(*licensefiles) && !license; i++) { Err bitreich.org 70 i+ for (i = 0; i < LEN(licensefiles) && !license; i++) { Err bitreich.org 70 i if (!git_revparse_single(&obj, repo, licensefiles[i]) && Err bitreich.org 70 i git_object_type(obj) == GIT_OBJ_BLOB) Err bitreich.org 70 i license = licensefiles[i] + strlen("HEAD:"); Err bitreich.org 70 i@@ -1322,7 +1324,7 @@ main(int argc, char *argv[]) Err bitreich.org 70 i } Err bitreich.org 70 i Err bitreich.org 70 i /* check README */ Err bitreich.org 70 i- for (i = 0; i < sizeof(readmefiles) / sizeof(*readmefiles) && !readme; i++) { Err bitreich.org 70 i+ for (i = 0; i < LEN(readmefiles) && !readme; i++) { Err bitreich.org 70 i if (!git_revparse_single(&obj, repo, readmefiles[i]) && Err bitreich.org 70 i git_object_type(obj) == GIT_OBJ_BLOB) Err bitreich.org 70 i readme = readmefiles[i] + strlen("HEAD:"); Err bitreich.org 70 .