Changeset 99cc3dceec1bb97699f4e130556ce22975e39b6f
- Timestamp:
- 10/18/09 13:35:29 (5 weeks ago)
- Author:
- Karl Ramm <kcr@1ts.org>
- Parents:
- 6ea3890b92add2d38b6907fc33d3ac71ab76db92
- Children:
- a957e9285b443c0e7c978318a7e67324b6085139
- git-committer:
- Karl Ramm <kcr@1ts.org> / 2009-10-18T13:35:29Z-0400
- Message:
-
Revert "Add a zephyr randomizer as an alternative to default_zephyr_signature()"
This reverts commit f816ff1bcc839eb7c77fe93185f279da47f3473e.
That code was clearly wrong.
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
rf816ff1
|
r99cc3dc
|
|
| 447 | 447 | } |
| 448 | 448 | |
| 449 | | =head3 random_zephyr_siganture |
| 450 | | |
| 451 | | Pick a random zephyr signature. |
| 452 | | |
| 453 | | =head3 reload_zephyr_signatures |
| 454 | | |
| 455 | | Reload the random zephyr signatures |
| 456 | | |
| 457 | | =head3 $random_zsig_separator |
| 458 | | |
| 459 | | What to split the zsigs on |
| 460 | | |
| 461 | | =cut |
| 462 | | |
| 463 | | our $random_zsig_separator='\n'; |
| 464 | | |
| 465 | | { |
| 466 | | my $zsigs; |
| 467 | | |
| 468 | | sub reload_zephyr_signatures { |
| 469 | | my $slurp; |
| 470 | | |
| 471 | | srand; |
| 472 | | |
| 473 | | if (open(ZSIGS, "$ENV{'HOME'}/.zsigs")) { |
| 474 | | { |
| 475 | | local $/ = undef; |
| 476 | | $slurp = <ZSIGS>; |
| 477 | | } |
| 478 | | $zsigs = [split(/$random_zsig_separator/, $slurp)]; |
| 479 | | } else { |
| 480 | | $zsigs = [default_zephyr_signature()]; |
| 481 | | } |
| 482 | | } |
| 483 | | |
| 484 | | sub random_zephyr_signature { |
| 485 | | if (!defined($zsigs)) { |
| 486 | | reload_zephyr_signatures(); |
| 487 | | } |
| 488 | | return $zsigs->[int(rand($#{$zsigs}))]; |
| 489 | | } |
| 490 | | } |
| 491 | | |
| 492 | 449 | # Stub for owl::startup / BarnOwl::startup, so it isn't bound to the |
| 493 | 450 | # startup command. This may be redefined in a user's configfile. |