diff --git a/bin/auto b/bin/auto index 2cd3173..c37548d 100755 --- a/bin/auto +++ b/bin/auto @@ -19,7 +19,6 @@ use Class::Unload; use FindBin qw($Bin); our $Bin = $Bin; ## no critic qw(NamingConventions::Capitalization Variables::ProhibitPackageVars) BEGIN { - $Bin =~ s/\s/%20/gxsm; unshift @INC, "$Bin/../lib"; open my $gitfh, '<', "$Bin/../.git/refs/heads/indev"; diff --git a/doc/CHANGELOG b/doc/CHANGELOG index e553c78..59243e5 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev =============================================================================== + * Added fpfmt() to API::Std. * Auto::GR renamed to $Auto::VERGITREV. * Bumped minimum version for API to 3.0.0a6. * Changed on_topic args to: full source hashref, new topic array diff --git a/lib/API/Std.pm b/lib/API/Std.pm index 4ac986b..3dc4854 100644 --- a/lib/API/Std.pm +++ b/lib/API/Std.pm @@ -12,7 +12,7 @@ use base qw(Exporter); our (%LANGE, %MODULE, %EVENTS, %HOOKS, %CMDS); our @EXPORT_OK = qw(conf_get trans err awarn timer_add timer_del cmd_add cmd_del hook_add hook_del rchook_add rchook_del match_user - has_priv mod_exists ratelimit_check); + has_priv mod_exists ratelimit_check fpfmt); # Initialize a module. @@ -516,6 +516,14 @@ sub awarn return 1; } +# Formatting a file path. +sub fpfmt { + my ($path) = @_; + + if ($path =~ m/\s/xsm) { return "\"$path\""; } + else { return $path; } +} + 1; # vim: set ai et sw=4 ts=4: