]>
git.cameronkatri.com Git - cgit.git/blob - ui-blob.c
3 void cgit_print_blob(struct cacheitem
*item
, const char *hex
, char *path
)
6 unsigned char sha1
[20];
11 if (get_sha1_hex(hex
, sha1
)){
12 cgit_print_error(fmt("Bad hex value: %s", hex
));
16 type
= sha1_object_info(sha1
, &size
);
17 if (type
== OBJ_BAD
) {
18 cgit_print_error(fmt("Bad object name: %s", hex
));
22 buf
= read_sha1_file(sha1
, &type
, &size
);
24 cgit_print_error(fmt("Error reading object %s", hex
));
29 cgit_print_snapshot_start("text/plain", path
, item
);
30 write(htmlfd
, buf
, size
);