From 47955dd43ad090e81847df37c86175aaea9e037f Mon Sep 17 00:00:00 2001 From: Uriel Date: Mon, 16 Feb 2009 02:27:28 +0000 Subject: [PATCH] Replace switch with series of if, makes the code slightly cleaner, I think. --- apps/blagh/app.rc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/blagh/app.rc b/apps/blagh/app.rc index ff5a047..f1fd936 100644 --- a/apps/blagh/app.rc +++ b/apps/blagh/app.rc @@ -26,26 +26,26 @@ fn blagh_init { ll_add handlers_bar_left echo 'Make a new post' } - switch($req_path) { - case $blagh_uri + if(~ $req_path $blagh_uri) { handler_body_main=blagh_body u=$blagh_uri'index' extraHeaders=$"extraHeaders ^ \ ' ' - case $blagh_uri^index.atom + } + if not if(~ $req_path $blagh_uri^index.atom) blagh_setup_feed_handlers atom.tpl - case $blagh_uri^index.rss + + if not if(~ $req_path $blagh_uri^index.rss) blagh_setup_feed_handlers rss20.tpl - case $blagh_uri^new_post - if(! ~ $#editor_mode 0) { - handler_body_main=( tpl_handler `{get_lib_file blagh/new_post.tpl apps/blagh/new_post.tpl} ) - if(~ $REQUEST_METHOD POST) { - if(mkbpost $"post_arg_body $"post_date $"post_arg_title $post_arg_id) - post_redirect $blagh_uri - if not - notify_errors=$status - } + + if not if(~ $req_path $blagh_uri^new_post && ! ~ $#editor_mode 0) { + handler_body_main=( tpl_handler `{get_lib_file blagh/new_post.tpl apps/blagh/new_post.tpl} ) + if(~ $REQUEST_METHOD POST) { + if(mkbpost $"post_arg_body $"post_date $"post_arg_title $post_arg_id) + post_redirect $blagh_uri + if not + notify_errors=$status } }