gitweb: Better git-unquoting and gitweb-quoting of pathnames

Extend unquote subroutine, which unquotes quoted and escaped filenames
which git may return, to deal not only with octal char sequence
quoting, but also quoting ordinary characters including '\"' and '\\'
which are respectively quoted '"' and '\', and to deal also with
C escape sequences including '\t' for TAB and '\n' for LF.

Add esc_path subroutine for gitweb quoting and HTML escaping filenames
(currently it does equivalent of ls' --hide-control-chars, which means
showing undisplayable characters (including '\n' and '\t') as '?'
(question mark) character, and use 'span' element with cntrl CSS class
to help rendering them differently.

Convert gitweb to use esc_path correctly to print pathnames.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2 files changed
tree: b38de4e8d6a289f0ca31e728d265451158d95057
  1. arm/
  2. compat/
  3. contrib/
  4. Documentation/
  5. gitweb/
  6. mozilla-sha1/
  7. perl/
  8. ppc/
  9. t/
  10. templates/
  11. xdiff/
  12. .gitignore
  13. alloc.c
  14. archive-tar.c
  15. archive-zip.c
  16. archive.h
  17. base85.c
  18. blame.c
  19. blob.c
  20. blob.h
  21. builtin-add.c
  22. builtin-annotate.c
  23. builtin-apply.c
  24. builtin-archive.c
  25. builtin-branch.c
  26. builtin-cat-file.c
  27. builtin-check-ref-format.c
  28. builtin-checkout-index.c
  29. builtin-commit-tree.c
  30. builtin-count-objects.c
  31. builtin-diff-files.c
  32. builtin-diff-index.c
  33. builtin-diff-stages.c
  34. builtin-diff-tree.c
  35. builtin-diff.c
  36. builtin-fmt-merge-msg.c
  37. builtin-for-each-ref.c
  38. builtin-grep.c
  39. builtin-init-db.c
  40. builtin-log.c
  41. builtin-ls-files.c
  42. builtin-ls-tree.c
  43. builtin-mailinfo.c
  44. builtin-mailsplit.c
  45. builtin-mv.c
  46. builtin-name-rev.c
  47. builtin-pack-objects.c
  48. builtin-pack-refs.c
  49. builtin-pickaxe.c
  50. builtin-prune-packed.c
  51. builtin-prune.c
  52. builtin-push.c
  53. builtin-read-tree.c
  54. builtin-repo-config.c
  55. builtin-rev-list.c
  56. builtin-rev-parse.c
  57. builtin-rm.c
  58. builtin-runstatus.c
  59. builtin-show-branch.c
  60. builtin-show-ref.c
  61. builtin-stripspace.c
  62. builtin-symbolic-ref.c
  63. builtin-tar-tree.c
  64. builtin-unpack-objects.c
  65. builtin-update-index.c
  66. builtin-update-ref.c
  67. builtin-upload-archive.c
  68. builtin-verify-pack.c
  69. builtin-write-tree.c
  70. builtin.h
  71. cache-tree.c
  72. cache-tree.h
  73. cache.h
  74. check-builtins.sh
  75. check-racy.c
  76. color.c
  77. color.h
  78. combine-diff.c
  79. commit.c
  80. commit.h
  81. config.c
  82. config.mak.in
  83. configure.ac
  84. connect.c
  85. convert-objects.c
  86. copy.c
  87. COPYING
  88. csum-file.c
  89. csum-file.h
  90. ctype.c
  91. daemon.c
  92. date.c
  93. delta.h
  94. describe.c
  95. diff-delta.c
  96. diff-lib.c
  97. diff.c
  98. diff.h
  99. diffcore-break.c
  100. diffcore-delta.c
  101. diffcore-order.c
  102. diffcore-pickaxe.c
  103. diffcore-rename.c
  104. diffcore.h
  105. dir.c
  106. dir.h
  107. dump-cache-tree.c
  108. entry.c
  109. environment.c
  110. exec_cmd.c
  111. exec_cmd.h
  112. fetch-pack.c
  113. fetch.c
  114. fetch.h
  115. fsck-objects.c
  116. generate-cmdlist.sh
  117. git-am.sh
  118. git-applymbox.sh
  119. git-applypatch.sh
  120. git-archimport.perl
  121. git-bisect.sh
  122. git-checkout.sh
  123. git-clean.sh
  124. git-clone.sh
  125. git-commit.sh
  126. git-compat-util.h
  127. git-cvsexportcommit.perl
  128. git-cvsimport.perl
  129. git-cvsserver.perl
  130. git-fetch.sh
  131. git-instaweb.sh
  132. git-lost-found.sh
  133. git-ls-remote.sh
  134. git-merge-octopus.sh
  135. git-merge-one-file.sh
  136. git-merge-ours.sh
  137. git-merge-recursive-old.py
  138. git-merge-resolve.sh
  139. git-merge-stupid.sh
  140. git-merge.sh
  141. git-p4import.py
  142. git-parse-remote.sh
  143. git-pull.sh
  144. git-quiltimport.sh
  145. git-rebase.sh
  146. git-relink.perl
  147. git-repack.sh
  148. git-request-pull.sh
  149. git-rerere.perl
  150. git-reset.sh
  151. git-resolve.sh
  152. git-revert.sh
  153. git-send-email.perl
  154. git-sh-setup.sh
  155. git-shortlog.perl
  156. git-svn.perl
  157. git-svnimport.perl
  158. git-tag.sh
  159. git-verify-tag.sh
  160. GIT-VERSION-GEN
  161. git.c
  162. git.spec.in
  163. gitk
  164. gitMergeCommon.py
  165. grep.c
  166. grep.h
  167. hash-object.c
  168. help.c
  169. http-fetch.c
  170. http-push.c
  171. http.c
  172. http.h
  173. ident.c
  174. imap-send.c
  175. index-pack.c
  176. INSTALL
  177. interpolate.c
  178. interpolate.h
  179. list-objects.c
  180. list-objects.h
  181. local-fetch.c
  182. lockfile.c
  183. log-tree.c
  184. log-tree.h
  185. Makefile
  186. merge-base.c
  187. merge-file.c
  188. merge-index.c
  189. merge-recursive.c
  190. merge-tree.c
  191. mktag.c
  192. mktree.c
  193. object-refs.c
  194. object.c
  195. object.h
  196. pack-check.c
  197. pack-redundant.c
  198. pack.h
  199. pager.c
  200. patch-delta.c
  201. patch-id.c
  202. path-list.c
  203. path-list.h
  204. path.c
  205. peek-remote.c
  206. pkt-line.c
  207. pkt-line.h
  208. quote.c
  209. quote.h
  210. read-cache.c
  211. README
  212. receive-pack.c
  213. refs.c
  214. refs.h
  215. revision.c
  216. revision.h
  217. rsh.c
  218. rsh.h
  219. run-command.c
  220. run-command.h
  221. send-pack.c
  222. server-info.c
  223. setup.c
  224. sha1_file.c
  225. sha1_name.c
  226. shell.c
  227. show-index.c
  228. sideband.c
  229. sideband.h
  230. ssh-fetch.c
  231. ssh-pull.c
  232. ssh-push.c
  233. ssh-upload.c
  234. strbuf.c
  235. strbuf.h
  236. tag.c
  237. tag.h
  238. tar.h
  239. test-date.c
  240. test-delta.c
  241. test-sha1.c
  242. test-sha1.sh
  243. trace.c
  244. tree-diff.c
  245. tree-walk.c
  246. tree-walk.h
  247. tree.c
  248. tree.h
  249. unpack-file.c
  250. unpack-trees.c
  251. unpack-trees.h
  252. update-server-info.c
  253. upload-pack.c
  254. usage.c
  255. var.c
  256. write_or_die.c
  257. wt-status.c
  258. wt-status.h
  259. xdiff-interface.c
  260. xdiff-interface.h