From 278ea6e03720db50312c8cdcbf6a891e4f2fba63 Mon Sep 17 00:00:00 2001 From: joey Date: Sun, 26 Nov 2006 20:52:37 +0000 Subject: [PATCH] bugfix --- IkiWiki/Plugin/poll.pm | 2 +- doc/news/openid.mdwn | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/poll.pm b/IkiWiki/Plugin/poll.pm index bca8f5d54..d598c3208 100644 --- a/IkiWiki/Plugin/poll.pm +++ b/IkiWiki/Plugin/poll.pm @@ -108,7 +108,7 @@ sub cgi ($) { #{{{ if (--$num == 0) { $params=~s/(^|\s+)(\d+)\s+"?\Q$choice\E"?(\s+|$)/$1.($2+1)." \"$choice\"".$3/se; if (defined $oldchoice) { - $params=~s/(^|\s+)(\d+)\s+"?\Q$oldchoice\E"?(\s+|$)/$1.($2-1)." \"$oldchoice\"".$3/se; + $params=~s/(^|\s+)(\d+)\s+"?\Q$oldchoice\E"?(\s+|$)/$1.($2-1 >=0 ? $2-1 : 0))." \"$oldchoice\"".$3/se; } } return "[[poll $params]]"; diff --git a/doc/news/openid.mdwn b/doc/news/openid.mdwn index 742fa06a9..f13aeed8b 100644 --- a/doc/news/openid.mdwn +++ b/doc/news/openid.mdwn @@ -10,6 +10,6 @@ log back in, try out the OpenID signup process if you don't already have an OpenID, and see how OpenID works for you. And let me know your feelings about making such a switch. -[[poll -1 "Accept only OpenID for logins" 1 "Accept only password logins" 0 "Accept both"]] +[[poll 0 "Accept only OpenID for logins" 1 "Accept only password logins" 0 "Accept both"]] --[[Joey]] -- 2.39.5