summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2008-12-05 18:04:17 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-12-05 18:04:17 (UTC)
commit7115f7d257b5e3fb5d5d7ad6299214506fb35042 (patch) (side-by-side diff)
tree844631b9f2a6354fcd988a13dfb9b1d567cb6344
parenta5e899e4c786e2ed7f58874d66956bf196cef8df (diff)
downloadcgit-7115f7d257b5e3fb5d5d7ad6299214506fb35042.zip
cgit-7115f7d257b5e3fb5d5d7ad6299214506fb35042.tar.gz
cgit-7115f7d257b5e3fb5d5d7ad6299214506fb35042.tar.bz2
ui-repolist: avoid build warning for strcasestr(3)
The non-standard function strcasestr is only defined if _GNU_SOURCE has also been defined. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--ui-repolist.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui-repolist.c b/ui-repolist.c
index c23232c..2324273 100644
--- a/ui-repolist.c
+++ b/ui-repolist.c
@@ -1,32 +1,36 @@
/* ui-repolist.c: functions for generating the repolist page
*
* Copyright (C) 2006 Lars Hjemli
*
* Licensed under GNU General Public License v2
* (see COPYING for full license text)
*/
+/* This is needed for strcasestr to be defined by <string.h> */
+#define _GNU_SOURCE 1
+#include <string.h>
+
#include <time.h>
#include "cgit.h"
#include "html.h"
#include "ui-shared.h"
time_t read_agefile(char *path)
{
FILE *f;
static char buf[64], buf2[64];
if (!(f = fopen(path, "r")))
return -1;
if (fgets(buf, sizeof(buf), f) == NULL)
return -1;
fclose(f);
if (parse_date(buf, buf2, sizeof(buf2)))
return strtoul(buf2, NULL, 10);
else
return 0;
}
static void print_modtime(struct cgit_repo *repo)
{