summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9ce392f)
raw | patch | inline | side by side (parent: 9ce392f)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 22 Nov 2005 07:44:35 +0000 (23:44 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 22 Nov 2005 07:44:35 +0000 (23:44 -0800) |
var.c::git_var read function did not have to return writable
strings; make it and the functions it points at return const char *
instead.
ident.c::get_ident() did not need to be global, so make it
static.
Signed-off-by: Junio C Hamano <junkio@cox.net>
strings; make it and the functions it points at return const char *
instead.
ident.c::get_ident() did not need to be global, so make it
static.
Signed-off-by: Junio C Hamano <junkio@cox.net>
cache.h | patch | blob | history | |
ident.c | patch | blob | history | |
var.c | patch | blob | history |
index c7c6637b1ff0135281cabd800efbbf38ee72d627..6ac94c5a1f0ccdc956b006eaa9a176835f5726fb 100644 (file)
--- a/cache.h
+++ b/cache.h
unsigned long approxidate(const char *);
extern int setup_ident(void);
-extern char *get_ident(const char *name, const char *email, const char *date_str);
-extern char *git_author_info(void);
-extern char *git_committer_info(void);
+extern const char *git_author_info(void);
+extern const char *git_committer_info(void);
static inline void *xmalloc(size_t size)
{
index bc89e1d04c63563c051005754a50247f22256974..ac1c27f1998b8245132dced5875e022fe24b93ec 100644 (file)
--- a/ident.c
+++ b/ident.c
return offset;
}
-char *get_ident(const char *name, const char *email, const char *date_str)
+static const char *get_ident(const char *name, const char *email,
+ const char *date_str)
{
static char buffer[1000];
char date[50];
return buffer;
}
-char *git_author_info(void)
+const char *git_author_info(void)
{
- return get_ident(getenv("GIT_AUTHOR_NAME"), getenv("GIT_AUTHOR_EMAIL"), getenv("GIT_AUTHOR_DATE"));
+ return get_ident(getenv("GIT_AUTHOR_NAME"),
+ getenv("GIT_AUTHOR_EMAIL"),
+ getenv("GIT_AUTHOR_DATE"));
}
-char *git_committer_info(void)
+const char *git_committer_info(void)
{
- return get_ident(getenv("GIT_COMMITTER_NAME"), getenv("GIT_COMMITTER_EMAIL"), getenv("GIT_COMMITTER_DATE"));
+ return get_ident(getenv("GIT_COMMITTER_NAME"),
+ getenv("GIT_COMMITTER_EMAIL"),
+ getenv("GIT_COMMITTER_DATE"));
}
index 51cf86a5843acc3b6bc3d8c4be9fec0fdd0a0df5..98044594c33245e37e2baca603944db68f3b381f 100644 (file)
--- a/var.c
+++ b/var.c
struct git_var {
const char *name;
- char *(*read)(void);
+ const char *(*read)(void);
};
static struct git_var git_vars[] = {
{ "GIT_COMMITTER_IDENT", git_committer_info },