Fossil SCM
Add the noreadme query parameter to /dir
Commit
bf3383b957bb2fffc48574abe3eedc0df409efdea6ac899fb5e89de13af5ded7
Parent
9512ed93d37a7cf…
1 file changed
+9
+9
| --- src/browse.c | ||
| +++ src/browse.c | ||
| @@ -116,10 +116,11 @@ | ||
| 116 | 116 | ** |
| 117 | 117 | ** name=PATH Directory to display. Optional. Top-level if missing |
| 118 | 118 | ** ci=LABEL Show only files in this check-in. Optional. |
| 119 | 119 | ** type=TYPE TYPE=flat: use this display |
| 120 | 120 | ** TYPE=tree: use the /tree display instead |
| 121 | +** noreadme Do not attempt to display the README file. | |
| 121 | 122 | */ |
| 122 | 123 | void page_dir(void){ |
| 123 | 124 | char *zD = fossil_strdup(P("name")); |
| 124 | 125 | int nD = zD ? strlen(zD)+1 : 0; |
| 125 | 126 | int mxLen; |
| @@ -294,10 +295,18 @@ | ||
| 294 | 295 | } |
| 295 | 296 | } |
| 296 | 297 | db_finalize(&q); |
| 297 | 298 | manifest_destroy(pM); |
| 298 | 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 | + } | |
| 299 | 308 | |
| 300 | 309 | /* If the directory contains a readme file, then display its content below |
| 301 | 310 | ** the list of files |
| 302 | 311 | */ |
| 303 | 312 | db_prepare(&q, |
| 304 | 313 |
| --- 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 |