aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-19 11:00:18 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-19 11:00:27 +0200
commit6bf27664f8580430751f46c9d0bef474a0835fab (patch)
tree132f4b58bdc551fc4cf46c907582d102fd5e96d5
parenta5567dcff02be9b9b5622a6fee51f6cbb0f76727 (diff)
downloaddwim-6bf27664f8580430751f46c9d0bef474a0835fab.tar.gz
Fix dirname()
This bug had the side-effect of the chdir in path() failing.
-rwxr-xr-xdwim2
1 files changed, 1 insertions, 1 deletions
diff --git a/dwim b/dwim
index cde91fc..33953c0 100755
--- a/dwim
+++ b/dwim
@@ -182,6 +182,6 @@ sub run {
# dirname -- return path without last part
sub dirname {
my $path = shift;
- $path =~ s,/[^/]+,,;
+ $path =~ s,/[^/]+$,,;
return $path;
}