Fossil with Commonmark

Artifact [148acb26e3]
Login

Artifact 148acb26e32c104d2c602223b7c79dbf85f5a2a6:

Attachment "suppress-hex.patch" to ticket [a470443b64] added by anonymous 2010-12-13 23:07:47.
--- D:/Daten/Projects/Fossil/Fossil/changes/original/db.c	Sat Dec 11 00:10:23 2010
+++ D:/Daten/Projects/Fossil/Fossil/changes/changed/db.c	Mon Dec 13 22:54:35 2010
@@ -1561,6 +1561,7 @@
   { "proxy",         0,               32, "off"                 },
   { "repo-cksum",    0,                0, "on"                  },
   { "ssh-command",   0,               32, ""                    },
+  { "suppress-hex",  0,                0, "off"                 },
   { "web-browser",   0,               32, ""                    },
   { 0,0,0,0 }
 };
@@ -1641,6 +1642,9 @@
 **                     as a double-check of correctness.  Defaults to "on".
 **                     Disable on large repositories for a performance
 **                     improvement.
+**
+**    suppress-hex     Suppress the output of a hex dump on the artifact
+**                     page.
 **
 **    ssh-command      Command used to talk to a remote machine with
 **                     the "ssh://" protocol.
--- D:/Daten/Projects/Fossil/Fossil/changes/original/info.c	Mon Dec 13 22:01:25 2010
+++ D:/Daten/Projects/Fossil/Fossil/changes/changed/info.c	Mon Dec 13 23:21:21 2010
@@ -1171,9 +1171,13 @@
       @ <img src="%s(g.zBaseURL)/raw?name=%s(zUuid)&amp;m=%s(zMime)"></img>
       style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid);
     }else{
-      @ <pre>
-      hexdump(&content);
-      @ </pre>
+		if (db_get_boolean("suppress-hex", 0)==0){
+			@ <pre>
+			hexdump(&content);
+			@ </pre>
+		}else{	
+			@ This is a binary file. Sorry, but if you don't like a hex display, there is no appropriate method available to display it.
+		}
     }
     @ </blockquote>
   }