Permalink
Browse files

Generally handle trailing slashes in symlinks and unburden-home-dir.list

  • Loading branch information...
1 parent e866bfe commit 97821570982f6b87df947fd87c5406d3658089df @xtaran committed May 18, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 bin/unburden-home-dir
View
9 bin/unburden-home-dir
@@ -255,9 +255,12 @@ sub fix_dangling_links {
my ($type, $itemexpanded, $target) = @_;
my $link = readlink($itemexpanded);
- # Accept symlinks without trailing slash
- if ( $type eq 'd' or $type eq 'D' ) {
- $link .= '/' if ((!($link =~ /\/$/)) and -d $link);
+ # Accept existing symlinks or unburden-home-dir.list entries for
+ # directories with or without trailing slash
+ if ($type eq 'd' or $type eq 'D') {
+ $link =~ s{/$}{};
+ $itemexpanded =~ s{/$}{};
+ $target =~ s{/$}{};
}
# Check if link target is wanted target

0 comments on commit 9782157

Please sign in to comment.