{"thread":{"id":"52209","subject":"[PATCH] kset.h, tar.h: add missing header guard to prevent multiple inclusion","startedAt":"2019-11-07T10:12:55Z","lastAt":"2019-11-07T11:11:16Z","messageCount":2,"participants":["Elia Pinto","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"385690","messageId":"20191107101243.99744-1-gitter.spiros@gmail.com","threadId":"52209","inReplyTo":null,"subject":"[PATCH] kset.h, tar.h: add missing header guard to prevent multiple inclusion","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2019-11-07T10:12:43Z","receivedAt":"2019-11-07T10:12:55Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Add missing headers to prevent ill-effects from multiple inclusion.\n\nFound by the LGTM source code analyzer.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n kwset.h | 4 ++++\n tar.h   | 5 +++++\n 2 files changed, 9 insertions(+)\n\ndiff --git a/kwset.h b/kwset.h\nindex df99a92178..f50ecae573 100644\n--- a/kwset.h\n+++ b/kwset.h\n@@ -1,3 +1,6 @@\n+#ifndef KWSET_H\n+#define KWSET_H\n+\n /* This file has been copied from commit e7ac713d^ in the GNU grep git\n  * repository. A few small changes have been made to adapt the code to\n  * Git.\n@@ -59,3 +62,4 @@ size_t kwsexec(kwset_t, char const *, size_t, struct kwsmatch *);\n /* Deallocate the given keyword set and all its associated storage. */\n void kwsfree(kwset_t);\n \n+#endif /* KWSET_H */\ndiff --git a/tar.h b/tar.h\nindex 3467705e9b..6b258c4d4a 100644\n--- a/tar.h\n+++ b/tar.h\n@@ -1,3 +1,6 @@\n+#ifndef TAR_H\n+#define TAR_H\n+\n #define TYPEFLAG_AUTO\t\t'\\0'\n #define TYPEFLAG_REG\t\t'0'\n #define TYPEFLAG_LNK\t\t'2'\n@@ -23,3 +26,5 @@ struct ustar_header {\n \tchar devminor[8];\t/* 337 */\n \tchar prefix[155];\t/* 345 */\n };\n+\n+#endif /* TAR_H */\n-- \n2.24.0.rc0.467.g566ccdd3e4.dirty\n\n"},{"id":"385698","messageId":"xmqqeeykosa8.fsf@gitster-ct.c.googlers.com","threadId":"52209","inReplyTo":"20191107101243.99744-1-gitter.spiros@gmail.com","subject":"Re: [PATCH] kset.h, tar.h: add missing header guard to prevent multiple inclusion","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-11-07T11:11:11Z","receivedAt":"2019-11-07T11:11:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elia Pinto <gitter.spiros@gmail.com> writes:\n\n> Add missing headers to prevent ill-effects from multiple inclusion.\n>\n> Found by the LGTM source code analyzer.\n>\n> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>\n> ---\n>  kwset.h | 4 ++++\n>  tar.h   | 5 +++++\n>  2 files changed, 9 insertions(+)\n\nMakes sense; thanks.\n\n> diff --git a/kwset.h b/kwset.h\n> index df99a92178..f50ecae573 100644\n> --- a/kwset.h\n> +++ b/kwset.h\n> @@ -1,3 +1,6 @@\n> +#ifndef KWSET_H\n> +#define KWSET_H\n> +\n>  /* This file has been copied from commit e7ac713d^ in the GNU grep git\n>   * repository. A few small changes have been made to adapt the code to\n>   * Git.\n> @@ -59,3 +62,4 @@ size_t kwsexec(kwset_t, char const *, size_t, struct kwsmatch *);\n>  /* Deallocate the given keyword set and all its associated storage. */\n>  void kwsfree(kwset_t);\n>  \n> +#endif /* KWSET_H */\n> diff --git a/tar.h b/tar.h\n> index 3467705e9b..6b258c4d4a 100644\n> --- a/tar.h\n> +++ b/tar.h\n> @@ -1,3 +1,6 @@\n> +#ifndef TAR_H\n> +#define TAR_H\n> +\n>  #define TYPEFLAG_AUTO\t\t'\\0'\n>  #define TYPEFLAG_REG\t\t'0'\n>  #define TYPEFLAG_LNK\t\t'2'\n> @@ -23,3 +26,5 @@ struct ustar_header {\n>  \tchar devminor[8];\t/* 337 */\n>  \tchar prefix[155];\t/* 345 */\n>  };\n> +\n> +#endif /* TAR_H */\n"}]}