summaryrefslogtreecommitdiff
path: root/ui-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-view.c')
-rw-r--r--ui-view.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ui-view.c b/ui-view.c
index 85e223c..9d23c45 100644
--- a/ui-view.c
+++ b/ui-view.c
@@ -11,7 +11,7 @@
void cgit_print_view(const char *hex)
{
unsigned char sha1[20];
- char type[20];
+ enum object_type type;
unsigned char *buf;
unsigned long size;
@@ -20,20 +20,22 @@ void cgit_print_view(const char *hex)
return;
}
- if (sha1_object_info(sha1, type, &size)){
- cgit_print_error("Bad object name");
+ type = sha1_object_info(sha1, &size);
+ if (type == OBJ_BAD) {
+ cgit_print_error(fmt("Bad object name: %s", hex));
return;
}
- buf = read_sha1_file(sha1, type, &size);
+ buf = read_sha1_file(sha1, &type, &size);
if (!buf) {
- cgit_print_error("Error reading object");
+ cgit_print_error(fmt("Error reading object %s", hex));
return;
}
buf[size] = '\0';
html("<table class='list'>\n");
- htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n", type, hex, size);
+ htmlf("<tr class='nohover'><th class='left'>%s %s, %li bytes</th></tr>\n",
+ typename(type), hex, size);
html("<tr><td class='blob'>\n");
html_txt(buf);
html("\n</td></tr>\n");
61c71b7124fad6df13bbf500b53&follow=1'>Changed changelog / added config-filenecoro2-0/+10 2006-10-05Added preference windownecoro4-49/+155 2006-10-02Corrected comments, structure, bad algorithms etcnecoro4-176/+209 2006-10-02Corrected indention in commentnecoro1-8/+6 2006-10-010.3.3necoro1-0/+6 2006-10-01Implemented an internal db; removed unmerge-bugnecoro2-26/+43 2006-09-30Implemented some new backend functions which speed up the ↵necoro2-12/+37 package-list-creation. (Thanks an porthole for the inspiration ;P) 2006-09-300.3.2 release; changed font in terminal; added new "masking"-dialognecoro3-11/+36 2006-09-29fixed bugsnecoro4-13/+23 2006-09-29Corrected setup.pynecoro1-1/+1