{"thread":{"id":"21500","subject":"[PATCH] gitweb: Fix blob linenr links in pathinfo mode","startedAt":"2009-11-06T15:08:41Z","lastAt":"2009-11-06T15:08:41Z","messageCount":1,"participants":["Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"126981","messageId":"1257520121-17282-1-git-send-email-pasky@suse.cz","threadId":"21500","inReplyTo":null,"subject":"[PATCH] gitweb: Fix blob linenr links in pathinfo mode","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2009-11-06T15:08:41Z","receivedAt":"2009-11-06T15:08:41Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"In pathinfo mode, we use <base href> that refers to the base location\nof gitweb in order for various external media links to work well.\nHowever, this means that for the page to refer to itself, it must\nregenerate full link, and this is exactly what the blob view page\ndid not do for line numbers.\n\nSigned-off-by: Petr Baudis <pasky@suse.cz>\n\n---\n gitweb/gitweb.perl |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl\nindex e4cbfc3..62325ea 100755\n--- a/gitweb/gitweb.perl\n+++ b/gitweb/gitweb.perl\n@@ -5127,7 +5127,8 @@ sub git_blob {\n \t\t\tchomp $line;\n \t\t\t$nr++;\n \t\t\t$line = untabify($line);\n-\t\t\tprintf \"<div class=\\\"pre\\\"><a id=\\\"l%i\\\" href=\\\"#l%i\\\" class=\\\"linenr\\\">%4i</a> %s</div>\\n\",\n+\t\t\tprintf \"<div class=\\\"pre\\\"><a id=\\\"l%i\\\" href=\\\"\" . href(-replay => 1)\n+\t\t\t\t. \"#l%i\\\" class=\\\"linenr\\\">%4i</a> %s</div>\\n\",\n \t\t\t       $nr, $nr, $nr, esc_html($line, -nbsp=>1);\n \t\t}\n \t}\n-- \ntg: (8cc62c1..) t/blob/pathinfo (depends on: vanilla/master)\n"}]}