Introduction
Introduction Statistics Contact Development Disclaimer Help
Do not set handler if man page doesn't exist so we can provide proper 404 (or o…
git clone git://git.suckless.org/swerc
Log
Files
Refs
README
---
commit 334881957c9b2327fa695f32a3873f69d9c7863a
parent 8933b60fd80c66b190ad6a813c594ceedc3bcb1f
Author: uriel@soma <unknown>
Date: Fri, 29 May 2009 10:04:27 +0000
Do not set handler if man page doesn't exist so we can provide proper 404 (or o…
Make 'Intro' page title fixing case-insensitive to deal with Plan B man pages.
Diffstat:
M apps/wman/app.rc | 16 +++++++++++++---
M apps/wman/man_page.tpl | 7 +------
2 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/apps/wman/app.rc b/apps/wman/app.rc
@@ -20,8 +20,17 @@ fn wman_init {
wman_cp='man'
wman_pe=.^$"wman_cat
}
- if(! ~ $"wman_cat '')
+
+ if(! ~ $"wman_cat '') {
wman_cat_path=$wman_man_path^/^$"wman_cp^$p(1)
+ if(! ~ $"wman_page '') {
+ wman_page_file=$wman_page^$"wman_pe
+ # Hack to handle 0intro files.
+ if(~ $wman_page intro && test -f $wman_cat_path^/0^$"wman_page_fil…
+ wman_page_file=0^$"wman_page_file
+ wman_page_file=$wman_cat_path^/^$"wman_page_file
+ }
+ }
wman_cat_list=`{ls -F $wman_man_path/*/ \
| sed -e $wman_junk_filter -e 's!.*/([^/]+)/[^/]+$!\1!; /[0-9]+/!d' \
@@ -34,7 +43,8 @@ fn wman_init {
if not if(~ $req_path $wman_base_uri^*) {
#^*/[a-z0-9]*[a-z]* $wman_base_uri^*/*[a-z]*[a-z0-9] $wman_base_uri^*/…
if(echo $req_path | grep -s '^'^$wman_base_uri^'/*[0-9]+/[0-9a-z\-\+\.…
- handler_body_main=(tpl_handler apps/wman/man_page.tpl)
+ if(test -f $wman_page_file) # Check for 404
+ handler_body_main=(tpl_handler apps/wman/man_page.tpl)
if not if(~ $req_path $wman_base_uri^*/)
handler_body_main=(tpl_handler apps/wman/page_list.tpl)
if not if(~ $p(2) [A-Z]* [0-9][A-Z]*) # Correct badly capitalized links
@@ -53,7 +63,7 @@ fn wman_init {
}
fn wman_get_section_desc {
- cat $wman_man_path/^$"wman_cp^$1/0intro* >[2]/dev/null| sed '1,2d; s!intro…
+ cat $wman_man_path/^$"wman_cp^$1/0intro* >[2]/dev/null| sed '1,2d; s!intro…
}
fn wman_page_gen {
diff --git a/apps/wman/man_page.tpl b/apps/wman/man_page.tpl
@@ -1,12 +1,7 @@
<pre>
%{
-# Hack to handle 0intro files.
-f=$wman_page^$"wman_pe
-if(~ $wman_page intro && test -f $wman_cat_path^/0^$f)
- f=0^$f
-
-wman_page_gen $wman_cat_path^/^$f
+wman_page_gen $wman_page_file
%}
</pre>
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.