Fossil SCM

Add the noreadme query parameter to /dir

drh 2019-09-06 13:49 trunk
Commit bf3383b957bb2fffc48574abe3eedc0df409efdea6ac899fb5e89de13af5ded7
1 file changed +9
--- src/browse.c
+++ src/browse.c
@@ -116,10 +116,11 @@
116116
**
117117
** name=PATH Directory to display. Optional. Top-level if missing
118118
** ci=LABEL Show only files in this check-in. Optional.
119119
** type=TYPE TYPE=flat: use this display
120120
** TYPE=tree: use the /tree display instead
121
+** noreadme Do not attempt to display the README file.
121122
*/
122123
void page_dir(void){
123124
char *zD = fossil_strdup(P("name"));
124125
int nD = zD ? strlen(zD)+1 : 0;
125126
int mxLen;
@@ -294,10 +295,18 @@
294295
}
295296
}
296297
db_finalize(&q);
297298
manifest_destroy(pM);
298299
@ </ul></div>
300
+
301
+ /* If the "noreadme" query parameter is present, do not try to
302
+ ** show the content of the README file.
303
+ */
304
+ if( P("noreadme")!=0 ){
305
+ style_footer();
306
+ return;
307
+ }
299308
300309
/* If the directory contains a readme file, then display its content below
301310
** the list of files
302311
*/
303312
db_prepare(&q,
304313
--- src/browse.c
+++ src/browse.c
@@ -116,10 +116,11 @@
116 **
117 ** name=PATH Directory to display. Optional. Top-level if missing
118 ** ci=LABEL Show only files in this check-in. Optional.
119 ** type=TYPE TYPE=flat: use this display
120 ** TYPE=tree: use the /tree display instead
 
121 */
122 void page_dir(void){
123 char *zD = fossil_strdup(P("name"));
124 int nD = zD ? strlen(zD)+1 : 0;
125 int mxLen;
@@ -294,10 +295,18 @@
294 }
295 }
296 db_finalize(&q);
297 manifest_destroy(pM);
298 @ </ul></div>
 
 
 
 
 
 
 
 
299
300 /* If the directory contains a readme file, then display its content below
301 ** the list of files
302 */
303 db_prepare(&q,
304
--- src/browse.c
+++ src/browse.c
@@ -116,10 +116,11 @@
116 **
117 ** name=PATH Directory to display. Optional. Top-level if missing
118 ** ci=LABEL Show only files in this check-in. Optional.
119 ** type=TYPE TYPE=flat: use this display
120 ** TYPE=tree: use the /tree display instead
121 ** noreadme Do not attempt to display the README file.
122 */
123 void page_dir(void){
124 char *zD = fossil_strdup(P("name"));
125 int nD = zD ? strlen(zD)+1 : 0;
126 int mxLen;
@@ -294,10 +295,18 @@
295 }
296 }
297 db_finalize(&q);
298 manifest_destroy(pM);
299 @ </ul></div>
300
301 /* If the "noreadme" query parameter is present, do not try to
302 ** show the content of the README file.
303 */
304 if( P("noreadme")!=0 ){
305 style_footer();
306 return;
307 }
308
309 /* If the directory contains a readme file, then display its content below
310 ** the list of files
311 */
312 db_prepare(&q,
313

Keyboard Shortcuts

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