Skip to content

Commit

Permalink
remove trailing slash after dir match and stop looking for ./ls++.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
trapd00r committed Jan 10, 2019
1 parent 3825a51 commit b5122e0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ls++
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# vim:ft=perl:et:
my $APP = 'ls++';
use vars qw($VERSION);
$VERSION = '0.40';
$VERSION = '0.42';

use strict;
use Term::ExtendedColor qw(fg uncolor);
Expand Down Expand Up @@ -290,10 +290,10 @@ sub add_ls_color {
-d $no_ls_color_file and $no_ls_color_file .= '/';

if($no_ls_color_file =~ m{$pattern}) {
$file = $no_ls_color_file;
if($ls_colors{$pattern} eq 'IGNORE') {
return undef;
}
$file = $no_ls_color_file;

# # add attributes
# # 'README$' => 'bold italic 220 underline',
Expand All @@ -302,6 +302,8 @@ sub add_ls_color {
}
}
}
# remove the trailing slash again
$file =~ s{/}{}g;
return $file;
}

Expand Down Expand Up @@ -604,7 +606,7 @@ sub _init_config {
}

my @locations = (
"./ls++.conf",
# "./ls++.conf",
"$ENV{XDG_CONFIG_HOME}/ls++/ls++.conf",
"$ENV{HOME}/.config/ls++/ls++.conf",
"$ENV{HOME}/.ls++.conf",
Expand Down

0 comments on commit b5122e0

Please sign in to comment.