swerc

anselm's simpler werc fork
git clone git://git.suckless.org/swerc
Log | Files | Refs | README

commit 772c66b41993566a74411edf076a46ac62b16a62
parent 1718321015a6ee8f4e9d64c341969e7b6fc9d54a
Author: uriel@soma <unknown>
Date:   Mon, 16 Mar 2009 23:42:44 +0000

Fix null concat in wman search code.
Diffstat:
Mapps/wman/app.rc | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/apps/wman/app.rc b/apps/wman/app.rc @@ -43,10 +43,12 @@ fn wman_init { # Search ll_add handlers_body_head tpl_handler apps/wman/search.tpl - s=`{echo $post_arg_wman_search | sed 's/[^a-zA-Z0-9\-\.]+//g; s/\.+/./g; 1q'} - ifs='' { wman_search_results=`{wman_ls_pages $wman_man_path/*/*^$s^*} } - if(! ~ $"post_arg_go '' && ~ `{echo -n $wman_search_results|wc -l} 1) - post_redirect $wman_base_uri^`{echo $wman_search_results|awk -F/ '{print $(NF-1)"/"$NF}'} + if(! ~ $"post_arg_wman_search '') { + s=`{echo $post_arg_wman_search | sed 's/[^a-zA-Z0-9\-\.]+//g; s/\.+/./g; 1q'} + ifs='' { wman_search_results=`{wman_ls_pages $wman_man_path/*/*^$"s^*} } + if(! ~ $"post_arg_go '' && ~ `{echo -n $wman_search_results|wc -l} 1) + post_redirect $wman_base_uri^`{echo $wman_search_results|awk -F/ '{print $(NF-1)"/"$NF}'} + } }