summaryrefslogtreecommitdiffabout
authorLars Hjemli <hjemli@gmail.com>2007-09-19 21:46:59 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-09-19 21:46:59 (UTC)
commit63d5f5eaeadf060a0c8c94ac3b32e51b469b6af3 (patch) (side-by-side diff)
treed6b31c994f861579e6d7085ba52a41a37cd69868
parent7921572fb1fd28ec7523fcf5ed03eaf8a3432e65 (diff)
downloadcgit-63d5f5eaeadf060a0c8c94ac3b32e51b469b6af3.zip
cgit-63d5f5eaeadf060a0c8c94ac3b32e51b469b6af3.tar.gz
cgit-63d5f5eaeadf060a0c8c94ac3b32e51b469b6af3.tar.bz2
ui-tree: specify parameter position for all htmlf formats
The GNU C library manual tells us that behavior is undefined if only some formats has a specification for the parameter position. Noticed-by: <mkraai@beckman.com> Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--ui-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui-tree.c b/ui-tree.c
index 1cb09f7..ef44d61 100644
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -22,49 +22,49 @@ static void print_object(const unsigned char *sha1, char *path)
if (type == OBJ_BAD) {
cgit_print_error(fmt("Bad object name: %s",
sha1_to_hex(sha1)));
return;
}
buf = read_sha1_file(sha1, &type, &size);
if (!buf) {
cgit_print_error(fmt("Error reading object %s",
sha1_to_hex(sha1)));
return;
}
html(" blob: <a href='");
html_attr(cgit_pageurl(cgit_query_repo, "blob", fmt("id=%s", sha1_to_hex(sha1))));
htmlf("'>%s</a>",sha1_to_hex(sha1));
html("<table class='blob'>\n");
idx = 0;
start = 0;
lineno = 0;
while(idx < size) {
if (buf[idx] == '\n') {
buf[idx] = '\0';
- htmlf("<tr><td class='no'><a name='%d'>%1$d</a></td><td class='txt'>",
+ htmlf("<tr><td class='no'><a name='%1$d'>%1$d</a></td><td class='txt'>",
++lineno);
html_txt(buf + start);
html("</td></tr>\n");
start = idx + 1;
}
idx++;
}
html("</table>\n");
}
static int ls_item(const unsigned char *sha1, const char *base, int baselen,
const char *pathname, unsigned int mode, int stage)
{
char *name;
char *fullpath;
enum object_type type;
unsigned long size = 0;
name = xstrdup(pathname);
fullpath = fmt("%s%s%s", cgit_query_path ? cgit_query_path : "",
cgit_query_path ? "/" : "", name);
type = sha1_object_info(sha1, &size);