Make pprint_tag void and cleans up call in cmd_cat_file.
Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
David Rientjes committed
Aug 14, 2006 at 13:19 UTC
eddd1c8cefa596abbb81ac5a0af21ba104033b3d
1 file changed
+5
-4
builtin-cat-file.c
+5
-4
@@ -26,7 +26,7 @@ static void flush_buffer(const char *buf, unsigned long size)
26
}
27
}
28
29
-static int pprint_tag(const unsigned char *sha1, const char *buf, unsigned long size)
29
+static void pprint_tag(const unsigned char *sha1, const char *buf, unsigned long size)
30
{
31
/* the parser in tag.c is useless here. */
32
const char *endp = buf + size;
@@ -91,7 +91,6 @@ static int pprint_tag(const unsigned char *sha1, const char *buf, unsigned long
91
*/
92
if (cp < endp)
93
flush_buffer(cp, endp - cp);
94
- return 0;
94
}
95
96
int cmd_cat_file(int argc, const char **argv, const char *prefix)
@@ -145,8 +144,10 @@ int cmd_cat_file(int argc, const char **argv, const char *prefix)
144
buf = read_sha1_file(sha1, type, &size);
145
if (!buf)
146
die("Cannot read object %s", argv[2]);
148
- if (!strcmp(type, tag_type))
149
- return pprint_tag(sha1, buf, size);
147
+ if (!strcmp(type, tag_type)) {
148
+ pprint_tag(sha1, buf, size);
149
+ return 0;
150
+ }
151
152
/* otherwise just spit out the data */
153
break;