Fossil SCM

Fix rendering on the /file page that causes text files to be reported as binary. Caused by check-in [6643d4a0c1aabb85].

drh 2021-01-04 15:18 trunk
Commit e5d30a7c34db7c2e7268b06b72c1ec999110396a080d8735bafe37c7062d041f
1 file changed +1 -1
+1 -1
--- src/info.c
+++ src/info.c
@@ -2509,11 +2509,11 @@
25092509
style_submenu_checkbox("ln", "Line Numbers", 0, 0);
25102510
}
25112511
blob_to_utf8_no_bom(&content, 0);
25122512
if( zMime==0 ) zMime = mimetype_from_content(&content);
25132513
@ <blockquote class="file-content">
2514
- if( zMime==0 ){
2514
+ if( zMime==0 || strncmp(zMime, "text/", 5)==0 ){
25152515
const char *z, *zFileName, *zExt;
25162516
z = blob_str(&content);
25172517
zFileName = db_text(0,
25182518
"SELECT name FROM mlink, filename"
25192519
" WHERE filename.fnid=mlink.fnid"
25202520
--- src/info.c
+++ src/info.c
@@ -2509,11 +2509,11 @@
2509 style_submenu_checkbox("ln", "Line Numbers", 0, 0);
2510 }
2511 blob_to_utf8_no_bom(&content, 0);
2512 if( zMime==0 ) zMime = mimetype_from_content(&content);
2513 @ <blockquote class="file-content">
2514 if( zMime==0 ){
2515 const char *z, *zFileName, *zExt;
2516 z = blob_str(&content);
2517 zFileName = db_text(0,
2518 "SELECT name FROM mlink, filename"
2519 " WHERE filename.fnid=mlink.fnid"
2520
--- src/info.c
+++ src/info.c
@@ -2509,11 +2509,11 @@
2509 style_submenu_checkbox("ln", "Line Numbers", 0, 0);
2510 }
2511 blob_to_utf8_no_bom(&content, 0);
2512 if( zMime==0 ) zMime = mimetype_from_content(&content);
2513 @ <blockquote class="file-content">
2514 if( zMime==0 || strncmp(zMime, "text/", 5)==0 ){
2515 const char *z, *zFileName, *zExt;
2516 z = blob_str(&content);
2517 zFileName = db_text(0,
2518 "SELECT name FROM mlink, filename"
2519 " WHERE filename.fnid=mlink.fnid"
2520

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button