chiark
/
gitweb
/
~mdw
/
tig
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4795d62
)
SIZEOF_REV introduced: 41 bytes of pure madness!
author
Jonas Fonseca
<fonseca@diku.dk>
Tue, 12 Sep 2006 03:44:54 +0000
(
05:44
+0200)
committer
Jonas Fonseca
<fonseca@antimatter.localdomain>
Tue, 12 Sep 2006 06:01:35 +0000
(08:01 +0200)
tig.c
patch
|
blob
|
blame
|
history
diff --git
a/tig.c
b/tig.c
index a871cb0e2a6458dbaa93a3d4c6b2e3170f743a77..711b9adefe57a657837ff765260bed80ce7c06b3 100644
(file)
--- a/
tig.c
+++ b/
tig.c
@@
-59,6
+59,7
@@
static size_t utf8_length(const char *string, size_t max_width, int *coloffset,
#define SIZEOF_STR 1024 /* Default string size. */
#define SIZEOF_REF 256 /* Size of symbolic or SHA1 ID. */
#define SIZEOF_STR 1024 /* Default string size. */
#define SIZEOF_REF 256 /* Size of symbolic or SHA1 ID. */
+#define SIZEOF_REV 41 /* Holds a SHA-1 and an ending NUL */
#define SIZEOF_REVGRAPH 19 /* Size of revision ancestry graphics. */
/* This color name can be used to refer to the default term colors. */
#define SIZEOF_REVGRAPH 19 /* Size of revision ancestry graphics. */
/* This color name can be used to refer to the default term colors. */
@@
-109,7
+110,7
@@
static size_t utf8_length(const char *string, size_t max_width, int *coloffset,
struct ref {
char *name; /* Ref name; tag or head names are shortened. */
struct ref {
char *name; /* Ref name; tag or head names are shortened. */
- char id[
41];
/* Commit SHA1 ID */
+ char id[
SIZEOF_REV];
/* Commit SHA1 ID */
unsigned int tag:1; /* Is it a tag? */
unsigned int next:1; /* For ref lists: are there more refs? */
};
unsigned int tag:1; /* Is it a tag? */
unsigned int next:1; /* For ref lists: are there more refs? */
};
@@
-2659,7
+2660,7
@@
static struct view_ops blob_ops = {
*/
struct commit {
*/
struct commit {
- char id[
41];
/* SHA1 ID. */
+ char id[
SIZEOF_REV];
/* SHA1 ID. */
char title[75]; /* First line of the commit message. */
char author[75]; /* Author of the commit. */
struct tm time; /* Date from the author ident. */
char title[75]; /* First line of the commit message. */
char author[75]; /* Author of the commit. */
struct tm time; /* Date from the author ident. */