Skip to content

Commit

Permalink
glob: remove function prototypes (#859)
Browse files Browse the repository at this point in the history
* When temporarily enabling warnings.pm, glob prints a warning: FastGlob::explode_glob() called too early to check prototype
* Remove the prototypes to silence the warning
* I didn't notice any other warnings when testing some glob inputs
  • Loading branch information
mknos authored Dec 5, 2024
1 parent 6c3eef1 commit fbfdc39
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bin/glob
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ $matched = 0;
# recursively wildcard expand a list of strings
#

sub match_glob($) {
sub match_glob {
local $_ = shift;

$matched = 0;
Expand Down Expand Up @@ -267,7 +267,7 @@ sub match_glob($) {
return sort(@res);
}

sub recurseglob($ $ @) {
sub recurseglob {
my($dir, $dirname, @comps) = @_;
my(@res) = ();
my($re, @names);
Expand Down Expand Up @@ -315,13 +315,13 @@ my %map_esc = ( '\\\\' => "\001",
);
my %unmap_esc = reverse %map_esc;

sub escape_glob($) {
sub escape_glob {
local $_ = shift;
s/( \\\\ | \\\{ | \\\} | \{\} )/$map_esc{$1}/gex;
$_;
}

sub unescape_glob($) {
sub unescape_glob {
local $_ = shift;
s/([\001-\004])/$unmap_esc{$1}/ge;
$_;
Expand All @@ -334,7 +334,7 @@ sub unescape_glob($) {
# So, for example, explode("ab{c,d}ef{g,h}ij") would be the
# resulting list: qw(abcefgij abdefgij abcefhij abdefhij)
#
sub explode_glob($) {
sub explode_glob {
local $_ = shift;

# Escape special characters and sequences
Expand Down Expand Up @@ -404,7 +404,7 @@ sub explode_glob($) {
# glob()
# explode a glob into words and match it against filenames
#
sub glob($) {
sub glob {
local $_ = shift;
my @globbed = ();
my @errmsgs = ();
Expand Down

0 comments on commit fbfdc39

Please sign in to comment.